private void metroButton1_Click(object sender, EventArgs e) { if (metroButton1.Text.ToString() == "" && metroTextBox5.Text.ToString() == "") { MetroMessageBox.Show(this, "Failed", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { try { MetroMessageBox.Show(this, metroButton1.Text.ToString()); hmssDataContext dbcon = new hmssDataContext(); Department dp = new Department(); dp.DepartmentName = metroTextBox1.Text.ToString(); dp.DepartmentDescription = metroTextBox5.Text.ToString(); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); metroTextBox1.Clear(); metroTextBox5.Clear(); } } }
private void submit_Click(object sender, EventArgs e) { if (idtb.Text.ToString() == "" && namtb.Text.ToString() == "" && agtb.Text.ToString() == "" && gntb.Text.ToString() == "" && adtb.Text.ToString() == "" && phtb.Text.ToString() == "" && satb.Text.ToString() == "") { MetroMessageBox.Show(this, "Failed.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { try { hmssDataContext dbcon = new hmssDataContext(); Doctor doc = new Doctor(); doc.DoctorID = idtb.Text.ToString(); doc.DoctorName = namtb.Text.ToString(); doc.DoctorAge = agtb.Text.ToString(); doc.DoctorGender = gntb.Text.ToString(); doc.DoctorAddress = adtb.Text.ToString(); doc.DoctorPhone = phtb.Text.ToString(); doc.DoctorSalary = satb.Text.ToString(); } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); idtb.Clear(); namtb.Clear(); agtb.Clear(); gntb.Clear(); adtb.Clear(); phtb.Clear(); satb.Clear(); } } }
private void show_Click(object sender, EventArgs e) { hmssDataContext dbcon = new hmssDataContext(); Accountant pro6 = new Accountant(); pro6 = dbcon.Accountants.SingleOrDefault(x => x.LoginID == holdID); if (pro6.AccountantID == holdID && holdProfile == "ACCOUNTANT") { MessageBox.Show(holdProfile); if (pro6 != null) { metroTextBox1.Text = pro6.AccountantName; metroTextBox2.Text = pro6.AccountantAge; metroTextBox3.Text = pro6.AccountantGender; metroTextBox4.Text = pro6.AccountantAddress; metroTextBox5.Text = pro6.AccountantPhone; metroTextBox6.Text = pro6.AccountantEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } }
private void show_Click(object sender, EventArgs e) { hmssDataContext dbcon = new hmssDataContext(); Patient pro2 = new Patient(); pro2 = dbcon.Patients.SingleOrDefault(x => x.LoginID == holdID); if (pro2.LoginID == holdID && holdProfile == "PATIENT") { if (pro2 != null) { MessageBox.Show("NOT NULL"); metroTextBox1.Text = pro2.PatientName; metroTextBox2.Text = pro2.PatientAge; metroTextBox3.Text = pro2.PatientGender; metroTextBox4.Text = pro2.PatientAddress; metroTextBox5.Text = pro2.PatientPhone; metroTextBox6.Text = "N/A"; } else { MessageBox.Show("NULL"); MetroMessageBox.Show(this, "NULL DATABASE.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } }
private void show_Click(object sender, EventArgs e) { hmssDataContext dbcon = new hmssDataContext(); Receptionist pro3 = new Receptionist(); pro3 = dbcon.Receptionists.SingleOrDefault(x => x.LoginID == holdID); MessageBox.Show(holdID, holdProfile); if (pro3.LoginID == holdID && holdProfile == "RECEPTIONIST") { if (pro3 != null) { metroTextBox1.Text = pro3.ReceptionistName; metroTextBox2.Text = pro3.ReceptionistAge; metroTextBox3.Text = pro3.ReceptionistGender; metroTextBox4.Text = pro3.ReceptionistAddress; metroTextBox5.Text = pro3.ReceptionistPhone; metroTextBox6.Text = pro3.ReceptionistEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } }
private void Submit_Click(object sender, EventArgs e) { if (metroTextBox1.Text.ToString() == "" && metroTextBox2.Text.ToString() == "" && metroTextBox3.Text.ToString() == "") { MetroMessageBox.Show(this, "Some Thing Went wrong", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { try { hmssDataContext dbcon = new hmssDataContext(); Room rm = new Room(); rm.RoomNo = metroTextBox1.Text.ToString(); rm.R_DateOfAdmition = metroTextBox2.Text.ToString(); rm.R_DateOfRelease = metroTextBox3.Text.ToString(); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Clear(); } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); Clear(); } } }
private void show_Click(object sender, EventArgs e) { hmssDataContext dbcon = new hmssDataContext(); Doctor pro5 = new Doctor(); pro5 = dbcon.Doctors.SingleOrDefault(x => x.LoginID == holdID); MessageBox.Show(holdID, holdProfile); if (pro5.LoginID == holdID && holdProfile == "DOCTOR") { if (pro5 != null) { metroTextBox1.Text = pro5.DoctorName; metroTextBox2.Text = pro5.DoctorAge; metroTextBox3.Text = pro5.DoctorGender; metroTextBox4.Text = pro5.DoctorAddress; metroTextBox5.Text = pro5.DoctorPhone; metroTextBox6.Text = pro5.DoctorEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } }
private void metroButton1_Click(object sender, EventArgs e) { string Pid = metroTextBox1.Text; string Pnam = metroTextBox2.Text; string Page = metroTextBox3.Text; string pgen = metroTextBox4.Text; string Pdob = metroTextBox5.Text; string Padd = metroTextBox6.Text; string Pphn = metroTextBox11.Text; string PBl = metroTextBox7.Text; string PRm = metroTextBox8.Text; string Pdatrel = metroTextBox9.Text; string PdocNam = metroTextBox10.Text; if (Pid.ToString() == "" && Pnam.ToString() == "" && Page.ToString() == "" && pgen.ToString() == "" && Pdob.ToString() == "" && Pdob.ToString() == "" && Padd.ToString() == "" && Pphn.ToString() == "" && PBl.ToString() == "" && PRm.ToString() == "" && Pdatrel.ToString() == "" && PdocNam.ToString() == "") { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { try { hmssDataContext dbcon = new hmssDataContext(); Patient pat = new Patient(); pat.PatientID = Pid; pat.PatientName = Pnam; pat.PatientAge = Page; pat.PatientGender = pgen; pat.PatientDateOfBirth = Pdob; pat.PatientAddress = Padd; pat.PatientPhone = Pphn; pat.PatientBloodGrooup = PBl; pat.PatientRoomNo = PRm; pat.PatientDateOfRelease = Pdatrel; pat.PatientDoctorName = PdocNam; } catch (Exception ex) { MetroMessageBox.Show(this, "Some Thing went wrong.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); metroTextBox1.Clear(); metroTextBox2.Clear(); metroTextBox3.Clear(); metroTextBox4.Clear(); metroTextBox5.Clear(); metroTextBox6.Clear(); metroTextBox7.Clear(); metroTextBox8.Clear(); metroTextBox9.Clear(); metroTextBox10.Clear(); metroTextBox11.Clear(); } } }
private void metroButton1_Click(object sender, EventArgs e) { string aID = metroTextBox1.Text; string aNam = metroTextBox2.Text; string aAdd = metroTextBox3.Text; string aPho = metroTextBox4.Text; string aSal = metroTextBox5.Text; string aAge = metroTextBox6.Text; string aGen = metroTextBox7.Text; string aEm = metroTextBox8.Text; if (aID.ToString() == "" && aNam.ToString() == "" && aAdd == "" && aPho == "" & aSal == "" && aAge == "" && aGen.ToString() == "" && aEm.ToString() == "") { MetroMessageBox.Show(this, "Something went wrong", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { try { hmssDataContext dbcon = new hmssDataContext(); Accountant ac = new Accountant(); ac.AccountantID = aID.ToString(); ac.AccountantName = aNam.ToString(); ac.AccountantAddress = aAdd.ToString(); ac.AccountantPhone = aPho.ToString(); ac.AccountantSalary = aSal.ToString(); ac.AccountantAge = aAge.ToString(); ac.AccountantGender = aGen.ToString(); ac.AccountantEmail = aEm.ToString(); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); clear(); } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); clear(); } } }
private void submit_Click(object sender, EventArgs e) { if (idtb.Text.ToString() == "" && datetb.Text.ToString() == "" && namtb.Text.ToString() == "" && doctb.Text.ToString() == "" && rmtb.Text.ToString() == "" && adtb.Text.ToString() == "" && reltb.Text.ToString() == "" && achgtb.Text.ToString() == "" && schgtb.Text.ToString() == "" && metroTextBox15.Text.ToString() == "" && rmchgperdaytb.Text.ToString() == "" && rmfordaytb.Text.ToString() == "" && vattb.Text.ToString() == "" && distb.Text.ToString() == "" && biltb.Text.ToString() == "" && logtb.Text.ToString() == "") { MetroMessageBox.Show(this, "Insert All!", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); Clear(); } else { try { hmssDataContext dbcon = new hmssDataContext(); Invoice inv = new Invoice(); inv.InvoiceID = idtb.Text.ToString(); inv.InvoiceDate = datetb.Text.ToString(); inv.I_PatientName = namtb.Text.ToString(); inv.I_DoctorName = doctb.Text.ToString(); inv.I_RoomNo = rmtb.Text.ToString(); inv.I_DateOfAdmition = adtb.Text.ToString(); inv.I_DateOfRelease = reltb.Text.ToString(); inv.I_AdmissionCharge = achgtb.Text.ToString(); inv.I_ServiceCharge = schgtb.Text.ToString(); inv.I_DoctorFees = metroTextBox15.Text.ToString(); inv.I_RoomChargePerDay = rmchgperdaytb.Text.ToString(); inv.I_RoomForDays = rmfordaytb.Text.ToString(); inv.I_Vat = vattb.Text.ToString(); inv.I_Discount = distb.Text.ToString(); inv.I_TotalBill = biltb.Text.ToString(); inv.LoginID = logtb.Text.ToString(); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Clear(); } catch (Exception ex) { MetroMessageBox.Show(this, "Failed.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); Clear(); } } }
private void metroButton1_Click(object sender, EventArgs e) { if (metroTextBox1.Text.ToString() == "" && metroTextBox2.Text.ToString() == "" && metroTextBox3.Text.ToString() == "" && metroTextBox4.Text.ToString() == "" && metroTextBox5.Text.ToString() == "" && metroTextBox6.Text.ToString() == "" && metroTextBox7.Text.ToString() == "" && metroTextBox7.Text.ToString() == "" && metroTextBox8.Text.ToString() == "") { MetroMessageBox.Show(this, "Something Went Wrong", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { try { hmssDataContext dbcon = new hmssDataContext(); Employee em = new Employee(); em.EmployeeID = metroTextBox1.Text.ToString(); em.EmployeeName = metroTextBox2.Text.ToString(); em.EmployeeAddress = metroTextBox3.Text.ToString(); em.EmployeePhone = metroTextBox4.Text.ToString(); em.EmployeeSalary = metroTextBox5.Text.ToString(); em.EmployeeAge = metroTextBox6.Text.ToString(); em.EmployeeGender = metroTextBox7.Text.ToString(); em.EmployeeEmail = metroTextBox8.Text.ToString(); } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); metroTextBox1.Clear(); metroTextBox2.Clear(); metroTextBox3.Clear(); metroTextBox4.Clear(); metroTextBox5.Clear(); metroTextBox6.Clear(); metroTextBox7.Clear(); metroTextBox8.Clear(); } } }
private void show_Click(object sender, EventArgs e) { hmssDataContext dbcon = new hmssDataContext(); Admin pro1 = new Admin(); pro1 = dbcon.Admins.SingleOrDefault(x => x.LoginID == holdID); if (pro1.LoginID == holdID && holdProfile == "ADMIN") { if (pro1 != null) { metroTextBox1.Text = pro1.AdminName; metroTextBox2.Text = "N/A"; metroTextBox3.Text = "N/A"; metroTextBox4.Text = "N/A"; metroTextBox5.Text = pro1.AdminPhone; metroTextBox6.Text = "N/A"; } else { MessageBox.Show(" NULL ADMIN"); MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } }
private void metroButton1_Click(object sender, EventArgs e) { try { hmssDataContext logindbcon = new hmssDataContext(); Login log = new Login(); log = logindbcon.Logins.SingleOrDefault(x => x.UserName == usernametf.Text && x.UserPassword == passwordtf.Text); if (log.UserProfile == "ADMIN" && usernametf.Text.ToString() == log.UserName && passwordtf.Text.ToString() == log.UserPassword) { LoginForm.ActiveForm.Hide(); new AdminForm().Show(); LoginID = log.UserID; LoginProfile = log.UserProfile; } if (log.UserProfile == "DOCTOR" && usernametf.Text.ToString() == log.UserName && passwordtf.Text.ToString() == log.UserPassword) { LoginForm.ActiveForm.Hide(); new DoctorForm().Show(); LoginID = log.UserID; LoginProfile = log.UserProfile; } if (log.UserProfile == "ACCOUNTANT" && usernametf.Text.ToString() == log.UserName && passwordtf.Text.ToString() == log.UserPassword) { LoginForm.ActiveForm.Hide(); new Accountantform().Show(); LoginID = log.UserID; LoginProfile = log.UserProfile; } if (log.UserProfile == "PATIENT" && usernametf.Text.ToString() == log.UserName && passwordtf.Text.ToString() == log.UserPassword) { LoginForm.ActiveForm.Hide(); new PatientForm().Show(); LoginID = log.UserID; LoginProfile = log.UserProfile; } if (log.UserProfile == "RECEPTIONEST" && usernametf.Text.ToString() == log.UserName && passwordtf.Text.ToString() == log.UserPassword) { LoginForm.ActiveForm.Hide(); new Receptionistfrom().Show(); LoginID = log.UserID; LoginProfile = log.UserProfile; } if (log.UserProfile == "EMPLOYEE" && usernametf.Text.ToString() == log.UserName && passwordtf.Text.ToString() == log.UserPassword) { LoginForm.ActiveForm.Hide(); } } catch (Exception ex) { MetroMessageBox.Show(this, "Incorrect Username or Password", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); usernametf.Clear(); passwordtf.Clear(); } }
private void show_Click(object sender, EventArgs e) { hmssDataContext dbcon = new hmssDataContext(); Admin pro1 = new Admin(); Receptionist pro3 = new Receptionist(); Employee pro4 = new Employee(); Doctor pro5 = new Doctor(); pro1 = dbcon.Admins.SingleOrDefault(x => x.LoginID == holdID); pro5 = dbcon.Doctors.SingleOrDefault(x => x.LoginID == holdID); pro3 = dbcon.Receptionists.SingleOrDefault(x => x.LoginID == holdID); pro4 = dbcon.Employees.SingleOrDefault(x => x.LoginID == holdID); MessageBox.Show(holdID, holdProfile); if (pro1.LoginID == holdID && holdProfile == "ADMIN") { if (pro1 != null) { MessageBox.Show("NOT NULL ADMIN"); metroTextBox1.Text = pro1.AdminName; metroTextBox2.Text = "N/A"; metroTextBox3.Text = "N/A"; metroTextBox4.Text = "N/A"; metroTextBox5.Text = pro1.AdminPhone; metroTextBox6.Text = "N/A"; } else { MessageBox.Show(" NULL ADMIN"); MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } Patient pro2 = new Patient(); pro2 = dbcon.Patients.SingleOrDefault(x => x.LoginID == holdID); if (pro2.LoginID == holdID && holdProfile == "PATIENT") { if (pro2 != null) { MessageBox.Show("NOT NULL"); metroTextBox1.Text = pro2.PatientName; metroTextBox2.Text = pro2.PatientAge; metroTextBox3.Text = pro2.PatientGender; metroTextBox4.Text = pro2.PatientAddress; metroTextBox5.Text = pro2.PatientPhone; metroTextBox6.Text = "N/A"; } else { MessageBox.Show("NULL"); MetroMessageBox.Show(this, "NULL DATABASE.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } Accountant pro6 = new Accountant(); pro6 = dbcon.Accountants.SingleOrDefault(x => x.LoginID == holdID); if (pro6.AccountantID == holdID && holdProfile == "ACCOUNTANT") { MessageBox.Show(holdProfile); if (pro6 != null) { metroTextBox1.Text = pro6.AccountantName; metroTextBox2.Text = pro6.AccountantAge; metroTextBox3.Text = pro6.AccountantGender; metroTextBox4.Text = pro6.AccountantAddress; metroTextBox5.Text = pro6.AccountantPhone; metroTextBox6.Text = pro6.AccountantEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } if (pro5.LoginID == holdID && holdProfile == "DOCTOR") { if (pro5 != null) { metroTextBox1.Text = pro5.DoctorName; metroTextBox2.Text = pro5.DoctorAge; metroTextBox3.Text = pro5.DoctorGender; metroTextBox4.Text = pro5.DoctorAddress; metroTextBox5.Text = pro5.DoctorPhone; metroTextBox6.Text = pro5.DoctorEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } else if (pro3.LoginID == holdID && holdProfile == "RECEPTIONIST") { if (pro3 != null) { metroTextBox1.Text = pro3.ReceptionistName; metroTextBox2.Text = pro3.ReceptionistAge; metroTextBox3.Text = pro3.ReceptionistGender; metroTextBox4.Text = pro3.ReceptionistAddress; metroTextBox5.Text = pro3.ReceptionistPhone; metroTextBox6.Text = pro3.ReceptionistEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } else if (pro4.LoginID == holdID && holdProfile == "Employee") { if (pro4 != null) { metroTextBox1.Text = pro4.EmployeeName; metroTextBox2.Text = pro4.EmployeeAge; metroTextBox3.Text = pro4.EmployeeGender; metroTextBox4.Text = pro4.EmployeeAddress; metroTextBox5.Text = pro4.EmployeePhone; metroTextBox6.Text = pro4.EmployeeEmail; } else { MetroMessageBox.Show(this, "Incorrect Data.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } } }