-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLecturer.cs
More file actions
69 lines (60 loc) · 1.88 KB
/
Lecturer.cs
File metadata and controls
69 lines (60 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using ElectricReg.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ElectricReg
{
public partial class Lecturer : Form
{
public Lecturer()
{
InitializeComponent();
}
private void btnHome_Click(object sender, EventArgs e)
{
this.Hide();
Home home = new Home();
home.ShowDialog();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Hide();
SignIn signIn = new SignIn();
signIn.ShowDialog();
}
private async void btnSignUp_Click(object sender, EventArgs e)
{
if(textBoxemail.Text == "" || textBoxLecturerID.Text == "" || textBoxName.Text == "" || textBoxphone.Text == "")
{
MessageBox.Show("Please insert all required details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var model = new LecturerModel
{
Email = textBoxemail.Text,
phoneNo = textBoxphone.Text,
lecturerId = int.Parse(textBoxLecturerID.Text),
LecturerName = textBoxName.Text
};
DatabaseService db = new DatabaseService();
try {
await db.getClient.From<LecturerModel>().Insert(model);
this.Hide();
Lectures lec = new Lectures();
lec.ShowDialog();
}
catch (Exception error){
MessageBox.Show(error.Message);
}
}
private void Lecturer_Load(object sender, EventArgs e)
{
}
}
}