private void ClassTiminglabel_Click(object sender, EventArgs e) { ClassTiming CT = new ClassTiming(); MainClass.showwindows(CT, this, MDI.ActiveForm); }
private void ROLESbtn_Click(object sender, EventArgs e) { Roles role = new Roles(); MainClass.showwindows(role, this, MDI.ActiveForm); }
private void ShiftBtn_Click(object sender, EventArgs e) { Shifts Shift = new Shifts(); MainClass.showwindows(Shift, this, MDI.ActiveForm); }
private void STAFFBTN_Click(object sender, EventArgs e) { Staff staf = new Staff(); MainClass.showwindows(staf, this, MDI.ActiveForm); }
private void NOTIFICATIONSBTN_Click(object sender, EventArgs e) { Notification Noti = new Notification(); MainClass.showwindows(Noti, this, MDI.ActiveForm); }
private void PERIODSBTN_Click(object sender, EventArgs e) { Periods peri = new Periods(); MainClass.showwindows(peri, this, MDI.ActiveForm); }
private void SUBJECTBTN_Click(object sender, EventArgs e) { Subjects sub = new Subjects(); MainClass.showwindows(sub, this, MDI.ActiveForm); }
private void SECTIONSBTN_Click(object sender, EventArgs e) { Sections sec = new Sections(); MainClass.showwindows(sec, this, MDI.ActiveForm); }
private void GROUPSBTN_Click(object sender, EventArgs e) { Groups grp = new Groups(); MainClass.showwindows(grp, this, MDI.ActiveForm); }
private void Addmissionbtn_Click(object sender, EventArgs e) { Addmission add = new Addmission(); MainClass.showwindows(add, this, MDI.ActiveForm); }
private void Classesbtn_Click(object sender, EventArgs e) { Classes clas = new Classes(); MainClass.showwindows(clas, this, MDI.ActiveForm); }
private void Staff_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); roleErrorLable.Visible = false; MainClass.Sno(Staff_dataGridView, "SnoGV"); }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (nameTxt.Text == "") { nameerrorlabel.Visible = true; } else { nameerrorlabel.Visible = false; } if (usernameTxt.Text == "") { usErrorLable.Visible = true; } else { usErrorLable.Visible = false; } if (passwordTxt.Text == "") { PAssErrorLable.Visible = true; } else { PAssErrorLable.Visible = false; } if (CpassTxt.Text == "") { CpassErrorLable.Visible = true; } else { CpassErrorLable.Visible = false; } if (passwordTxt.Text != CpassTxt.Text) { Mismatcherrorlabel.Visible = true; } else { Mismatcherrorlabel.Visible = false; } if (Phone1Txt.Text == "") { Ph1ErrorLable.Visible = true; } else { Ph1ErrorLable.Visible = false; } if (roleDD.SelectedIndex == -1) { roleErrorLable.Visible = true; } else { roleErrorLable.Visible = false; } if (StatusDD.SelectedIndex == -1) { statusErrorLable.Visible = true; } else { statusErrorLable.Visible = false; } if (nameerrorlabel.Visible || usErrorLable.Visible || PAssErrorLable.Visible || CpassErrorLable.Visible || Ph1ErrorLable.Visible || roleErrorLable.Visible || statusErrorLable.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else if (Mismatcherrorlabel.Visible) { MainClass.ShowMSG("Confirm Password is Invalid!", "Required", "Error"); } else { byte status = StatusDD.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0); if (edit == 0)// for save data entered by user { try { if (imageTxt.Text == "") { obj.St_insertStaffWithoutImage(nameTxt.Text, usernameTxt.Text, passwordTxt.Text, Phone1Txt.Text, Phone2Txt.Text, Convert.ToInt32(roleDD.SelectedValue.ToString()), status); MainClass.ShowMSG(nameTxt.Text + " added successfully", "Success....", "Success"); MainClass.disable_reset(panel6); loadData(); } else { //byte status = StatusDD.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0); MemoryStream MS = new MemoryStream(); image.Save(MS, ImageFormat.Jpeg); byte[] Pic = MS.ToArray(); obj.St_insertStaff(nameTxt.Text, usernameTxt.Text, passwordTxt.Text, Phone1Txt.Text, Phone2Txt.Text, Convert.ToInt32(roleDD.SelectedValue.ToString()), status, Pic); MainClass.ShowMSG(nameTxt.Text + " added successfully", "Success....", "Success"); MainClass.disable_reset(panel6); loadData(); } } catch { MainClass.ShowMSG("1.Dulpicate Username Received", "Dulpicate", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { if (image == null) { obj.St_updateStaffWithoutImage(nameTxt.Text, usernameTxt.Text, passwordTxt.Text, Phone1Txt.Text, Phone2Txt.Text, Convert.ToInt32(roleDD.SelectedValue.ToString()), status, staffID); MainClass.ShowMSG(nameTxt.Text + " updated successfully", "Success....", "Success"); MainClass.disable_reset(panel6); loadData(); } else { MemoryStream MS = new MemoryStream(); image.Save(MS, ImageFormat.Jpeg); byte[] pic = MS.ToArray(); obj.St_updateStaff(nameTxt.Text, usernameTxt.Text, passwordTxt.Text, Phone1Txt.Text, Phone2Txt.Text, Convert.ToInt32(roleDD.SelectedValue.ToString()), status, pic, staffID); MainClass.ShowMSG(nameTxt.Text + " updated successfully", "Success....", "Success"); MainClass.disable_reset(panel6); loadData(); } } catch { MainClass.ShowMSG("1.Dulpicate Username Received", "Dulpicate", "Error"); } } } roleErrorLable.Visible = false; SAVEbtn.Text = "SAVE"; }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (TimingnameTxt.Text == "") { TimingNameErrorLabel.Visible = true; } else { TimingNameErrorLabel.Visible = false; } if (T_shiftlDD.SelectedIndex == -1) { TimingShiftErrorLabel.Visible = true; } else { TimingShiftErrorLabel.Visible = false; } if (T_DayDD.SelectedIndex == -1) { T_dayErrorLabel.Visible = true; } else { T_dayErrorLabel.Visible = false; } if (TimingNameErrorLabel.Visible || T_dayErrorLabel.Visible || TimingShiftErrorLabel.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { TimeSpan startTime = new TimeSpan(startTimePicker.Value.Hour, startTimePicker.Value.Minute, startTimePicker.Value.Second); TimeSpan endTime = new TimeSpan(EndTimePicker.Value.Hour, EndTimePicker.Value.Minute, EndTimePicker.Value.Second); if (edit == 0)// for save data entered by user { try { timing t = new timing(); obj.st_insertTimings(TimingnameTxt.Text, Convert.ToInt32(T_shiftlDD.SelectedValue.ToString()), startTime, endTime, T_DayDD.SelectedItem.ToString()); obj.SubmitChanges(); MainClass.ShowMSG(TimingnameTxt.Text + " added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Dulpicate", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { obj.st_updateTimings(TimingnameTxt.Text, Convert.ToInt32(T_shiftlDD.SelectedValue.ToString()), startTime, endTime, T_DayDD.SelectedItem.ToString(), timingID); obj.SubmitChanges(); MainClass.ShowMSG(TimingnameTxt.Text + " updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); //SubjectErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Dulpicate", "Error"); } } } SAVEbtn.Text = "SAVE"; }
public override void ADDbtn_Click(object sender, EventArgs e) { MainClass.enable_reset(panel6); edit = 0; }
private void ClassTiming_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); loadlist(); }