public override void DELETEbtn_Click(object sender, EventArgs e) { if (edit == 1) { DialogResult Dr = MessageBox.Show("Are you sure you wanted to delete " + shiftnameTxt.Text + "?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (Dr == DialogResult.Yes) { obj.sh_deleteshifts(shiftsID); MainClass.ShowMSG(shiftnameTxt.Text + " shift deleted successfully", "Delete...", "Success"); MainClass.disable_reset(panel6); loadData(); } } }
public override void DELETEbtn_Click(object sender, EventArgs e) { if (edit == 1) { DialogResult Dr = MessageBox.Show("Are you sure you wanted to delete " + SubjectTxt.Text + "?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (Dr == DialogResult.Yes) { obj.St_deleteSubject(subjectID); MainClass.ShowMSG(SubjectTxt.Text + " deleted successfully", "Delete...", "Success"); MainClass.disable_reset(panel6); loadData(); SubjectErrorLabel.Visible = false; } } }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (PeriodTxt.Text == "") { PeriodErrorLabel.Visible = true; } else { PeriodErrorLabel.Visible = false; } if (PeriodErrorLabel.Visible /*|| usErrorLable.Visible || PAssErrorLable.Visible || CpassErrorLable.Visible || Mismatcherrorlabel.Visible || Ph1ErrorLable.Visible || roleErrorLable.Visible || statusErrorLable.Visible*/) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (edit == 0)// for save data entered by user { try { period Pr = new period(); obj.St_insertperiods(PeriodTxt.Text); obj.SubmitChanges(); MainClass.ShowMSG(PeriodTxt.Text + " added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); PeriodErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { obj.St_Updateperiods(PeriodTxt.Text, periodID); obj.SubmitChanges(); MainClass.ShowMSG(PeriodTxt.Text + " updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); PeriodErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } } SAVEbtn.Text = "SAVE"; }
private void Classes_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); MainClass.Sno(Classes_dataGridView, "SnoGV"); }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (shiftnameTxt.Text == "") { Shiftnameerrorlabel.Visible = true; } else { Shiftnameerrorlabel.Visible = false; } if (NumofshiftDD.SelectedIndex == -1) { Numofshifterrorlabel.Visible = true; } else { Numofshifterrorlabel.Visible = false; } if (endTimeTxt.Text == "") { endTimeErrorLabel.Visible = true; } else { endTimeErrorLabel.Visible = false; } if (startTimeTxt.Text == "") { startTimeErrorLabel.Visible = true; } else { startTimeErrorLabel.Visible = false; } if (Numofshifterrorlabel.Visible || Shiftnameerrorlabel.Visible || startTimeErrorLabel.Visible || endTimeErrorLabel.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (edit == 0)// for save data entered by user { try { shift S = new shift(); if (NumofshiftDD.SelectedIndex == 0) { S.sh_no_of_shift = 1; /*one*/ } else if (NumofshiftDD.SelectedIndex == 1) { S.sh_no_of_shift = 2; /*two*/ } else { S.sh_no_of_shift = 3;/*Three*/ } obj.sh_insertshifts(shiftnameTxt.Text, S.sh_no_of_shift, startTimeTxt.Text, endTimeTxt.Text); obj.SubmitChanges(); MainClass.ShowMSG(shiftnameTxt.Text + " shift added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { byte Numofshift; if (NumofshiftDD.SelectedIndex == 0) { Numofshift = 1; /*one*/ } else if (NumofshiftDD.SelectedIndex == 1) { Numofshift = 2; /*two*/ } else { Numofshift = 3; } obj.st_updateRoles(shiftnameTxt.Text, Numofshift, shiftsID); obj.SubmitChanges(); MainClass.ShowMSG(shiftnameTxt.Text + " shift updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } } SAVEbtn.Text = "SAVE"; }
private void Shifts_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (houseTxt.Text == "") { houseErrorLabel.Visible = true; } else { houseErrorLabel.Visible = false; } if (StatusDD.SelectedIndex == -1) { StatusErrorLabel.Visible = true; } else { StatusErrorLabel.Visible = false; } if (houseErrorLabel.Visible || StatusErrorLabel.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (edit == 0)// for save data entered by user { try { Group g = new Group(); if (StatusDD.SelectedIndex == 0) { g.Grp_status = 1; //Active } else { g.Grp_status = 0; //In-active } obj.St_insertGroups(houseTxt.Text, g.Grp_status); obj.SubmitChanges(); MainClass.ShowMSG(houseTxt.Text + " added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); houseErrorLabel.Visible = false; StatusErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { byte status; if (StatusDD.SelectedIndex == 0) { status = 1; //Active } else { status = 0; //In-active } obj.st_UpdateGroups(houseTxt.Text, status, groupID); obj.SubmitChanges(); MainClass.ShowMSG(houseTxt.Text + " updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); houseErrorLabel.Visible = false; StatusErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } } SAVEbtn.Text = "SAVE"; }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (SubjectTxt.Text == "") { SubjectErrorLabel.Visible = true; } else { SubjectErrorLabel.Visible = false; } if (ClassDD.SelectedIndex == -1) { SOCErrorLabel.Visible = true; } else { SOCErrorLabel.Visible = false; } if (SubjectErrorLabel.Visible /*|| usErrorLable.Visible || PAssErrorLable.Visible || CpassErrorLable.Visible || Mismatcherrorlabel.Visible || Ph1ErrorLable.Visible || roleErrorLable.Visible || statusErrorLable.Visible*/) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (edit == 0)// for save data entered by user { try { subject s = new subject(); obj.St_insertSubject(SubjectTxt.Text, Convert.ToInt32(ClassDD.SelectedValue.ToString())); obj.SubmitChanges(); MainClass.ShowMSG(SubjectTxt.Text + " added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); SubjectErrorLabel.Visible = false; } catch { MainClass.ShowMSG("1.Dulpicate Data Received", "Dulpicate", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { obj.St_UpdateSubject(SubjectTxt.Text, Convert.ToInt32(ClassDD.SelectedValue.ToString()), subjectID); obj.SubmitChanges(); MainClass.ShowMSG(SubjectTxt.Text + " updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); SubjectErrorLabel.Visible = false; } catch { MainClass.ShowMSG("1.Dulpicate Data Received", "Dulpicate", "Error"); } } } 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"; }
private void Addmission_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (StudentNameTxt.Text == "") { StudentNameErrorlabel.Visible = true; } else { StudentNameErrorlabel.Visible = false; } if (F_StudentNameTxt.Text == "") { F_StudentNameErrorlabel.Visible = true; } else { F_StudentNameErrorlabel.Visible = false; } if (M_StudentNameTxt.Text == "") { M_StudentNameErrorlabel.Visible = true; } else { M_StudentNameErrorlabel.Visible = false; } if (FatherProfessionTxt.Text == "") { FatherProfessionErrorLabel.Visible = true; } else { FatherProfessionErrorLabel.Visible = false; } if (DateofBirthTxt.Text == "") { DOBErrorLabel.Visible = true; } else { DOBErrorLabel.Visible = false; } if (NationaltyTxt.Text == "") { NationaltyErrorLabel.Visible = true; } else { NationaltyErrorLabel.Visible = false; } if (RelgionDD.SelectedIndex == -1) { RelgionErrorLabel.Visible = true; } else { RelgionErrorLabel.Visible = false; } if (GenderDD.SelectedIndex == -1) { GenderErrorLabel.Visible = true; } else { GenderErrorLabel.Visible = false; } if (ClassDD.SelectedIndex == -1) { Classerrorlabel.Visible = true; } else { Classerrorlabel.Visible = false; } if (SectionDD.SelectedIndex == -1) { SectionErrorLabel.Visible = true; } else { SectionErrorLabel.Visible = false; } if (Phone1Txt.Text == "") { Ph1ErrorLable.Visible = true; } else { Ph1ErrorLable.Visible = false; } if (Phoneno2Txt.Text == "") { Phone2Errorlabel.Visible = true; } else { Phone2Errorlabel.Visible = false; } if (AddressTxt.Text == "") { AddressErrorLabel.Visible = true; } else { AddressErrorLabel.Visible = false; } if (EmailTxt.Text == "") { EmailErrorLable.Visible = true; } else { EmailErrorLable.Visible = false; } if (StatusDD.SelectedIndex == -1) { statusErrorLable.Visible = true; } else { statusErrorLable.Visible = false; } if (imageTxt.Text == null) { picErrorLable.Visible = true; } else { picErrorLable.Visible = false; } if (StudentNameErrorlabel.Visible || F_StudentNameErrorlabel.Visible || M_StudentNameErrorlabel.Visible || FatherProfessionErrorLabel.Visible || NationaltyErrorLabel.Visible || RelgionErrorLabel.Visible || GenderErrorLabel.Visible || Classerrorlabel.Visible || SectionErrorLabel.Visible || DOBErrorLabel.Visible || Ph1ErrorLable.Visible || Phone2Errorlabel.Visible || AddressErrorLabel.Visible || EmailErrorLable.Visible || statusErrorLable.Visible || picErrorLable.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { addmission A = new addmission(); if (RelgionDD.SelectedIndex == 0) { A.ad_Relgion = 1; } else if (RelgionDD.SelectedIndex == 1) { A.ad_Relgion = 2; } else { A.ad_Relgion = 3; } byte Gender = GenderDD.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0); byte status = StatusDD.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0); if (edit == 0)// for save data entered by user { try { MemoryStream MS = new MemoryStream(); image.Save(MS, ImageFormat.Jpeg); byte[] Pic = MS.ToArray(); obj.ad_insertAddmission(StudentNameTxt.Text, F_StudentNameTxt.Text, M_StudentNameTxt.Text, FatherProfessionTxt.Text, DateofBirthTxt.Text, NationaltyTxt.Text, A.ad_Relgion, Gender, Convert.ToInt32(ClassDD.SelectedValue.ToString()), Convert.ToInt32(SectionDD.SelectedValue.ToString()), Phone1Txt.Text, Phoneno2Txt.Text, AddressTxt.Text, EmailTxt.Text, status, Pic); MainClass.ShowMSG(StudentNameTxt.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 { MemoryStream MS = new MemoryStream(); image.Save(MS, ImageFormat.Jpeg); byte[] Pic = MS.ToArray(); obj.ad_updateAddmission(StudentNameTxt.Text, F_StudentNameTxt.Text, M_StudentNameTxt.Text, FatherProfessionTxt.Text, DateofBirthTxt.Text, NationaltyTxt.Text, A.ad_Relgion, Gender, Convert.ToInt32(ClassDD.SelectedValue.ToString()), Convert.ToInt32(SectionDD.SelectedValue.ToString()), Phone1Txt.Text, Phoneno2Txt.Text, AddressTxt.Text, EmailTxt.Text, status, Pic, addmissionID); MainClass.ShowMSG(StudentNameTxt.Text + " updated successfully", "Success....", "Success"); MainClass.disable_reset(panel6); loadData(); } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Dulpicate", "Error"); } } } SAVEbtn.Text = "SAVE"; }
public override void SAVEbtn_Click(object sender, EventArgs e) { if (roleTxt.Text == "") { roleerrorlabel.Visible = true; } else { roleerrorlabel.Visible = false; } if (StatusDD.SelectedIndex == -1) { statuserrorlabel.Visible = true; } else { statuserrorlabel.Visible = false; } if (roleerrorlabel.Visible || statuserrorlabel.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (edit == 0)// for save data entered by user { try { role r = new role(); r.r_name = roleTxt.Text; if (StatusDD.SelectedIndex == 0) { r.r_status = 1; //Active } else { r.r_status = 0; //In-active } obj.st_insertRoles(roleTxt.Text, r.r_status); obj.SubmitChanges(); MainClass.ShowMSG(roleTxt.Text + " added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); roleerrorlabel.Visible = false; statuserrorlabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { byte status; if (StatusDD.SelectedIndex == 0) { status = 1; //Active } else { status = 0; //In-active } obj.st_updateRoles(roleTxt.Text, status, roleID); obj.SubmitChanges(); MainClass.ShowMSG(roleTxt.Text + " updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); roleerrorlabel.Visible = false; statuserrorlabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } } SAVEbtn.Text = "SAVE"; }
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 (ClassnameTxt.Text == "") { ClassNameErrorLabel.Visible = true; } else { ClassNameErrorLabel.Visible = false; } //if (levelDD.SelectedIndex == -1) { LevelErrorLabel.Visible = true; } else { LevelErrorLabel.Visible = false; } if (StatusDD.SelectedIndex == -1) { StatusErrorLabel.Visible = true; } else { StatusErrorLabel.Visible = false; } if (ClassNameErrorLabel.Visible || StatusErrorLabel.Visible /*|| LevelErrorLabel.Visible*/) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (edit == 0)// for save data entered by user { try { Clases c = new Clases(); if (StatusDD.SelectedIndex == 0) { c.clas_status = 1; //Active } else { c.clas_status = 0; //In-active } obj.St_insertClasses(ClassnameTxt.Text, c.clas_status); obj.SubmitChanges(); MainClass.ShowMSG(ClassnameTxt.Text + " added successfully", "Success...", "Success"); MainClass.disable_reset(panel6); loadData(); ClassNameErrorLabel.Visible = false; StatusErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } else if (edit == 1)// for Update perious data entered by user { try { byte status; if (StatusDD.SelectedIndex == 0) { status = 1; //Active } else { status = 0; //In-active } obj.st_UpdateClasses(ClassnameTxt.Text, status, classesID); obj.SubmitChanges(); MainClass.ShowMSG(ClassnameTxt.Text + " updated successfully", "Update...", "Success"); MainClass.disable_reset(panel6); loadData(); ClassNameErrorLabel.Visible = false; StatusErrorLabel.Visible = false; } catch (Exception ex) { MainClass.ShowMSG(ex.Message, "Error", "Error"); } } } SAVEbtn.Text = "SAVE"; }
private void Notification_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); MainClass.Sno(Noti_dataGridView, "SnoGV"); }
private void ClassTiming_Load(object sender, EventArgs e) { MainClass.disable_reset(panel6); loadlist(); }