private void metroTextButtonAddEmployeeConfirm_Click(object sender, EventArgs e) { try { hmsDataContext dbcon = new hmsDataContext(); Employee emp = new Employee(); Salary_ sl = new Salary_(); emp.EmployeeName = metroTextBox1.Text; emp.EmployeeAddress = metroTextBox3.Text; emp.EmployeePhone = metroTextBox4.Text; emp.EmployeeSalary = metroTextBox5.Text; emp.EmployeeProfile = metroComboBox1.Text; sl.Name = metroTextBox1.Text; sl.Salary = metroTextBox5.Text; sl.Profile = metroComboBox1.Text; dbcon.Employees.InsertOnSubmit(emp); dbcon.Salary_s.InsertOnSubmit(sl); dbcon.SubmitChanges(); // MessageBox.Show("Succesfully saved!!"); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); metroTextBox1.Clear(); metroTextBox3.Clear(); metroTextBox4.Clear(); metroTextBox5.Clear(); metroComboBox1.SelectedItem = null; } catch (Exception ex) { MetroMessageBox.Show(this, "Please insert all section.", "Warning!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation); } }
private void metroTextButtonLogin_Click(object sender, EventArgs e) { try { hmsDataContext DBcon = new hmsDataContext(); Login_ log = new Login_(); log = DBcon.Login_s.SingleOrDefault(x => x.LoginUserName == metroTextBox1.Text && x.LoginPassword == metroTextBox2.Text); if (log.Profile == "ADMIN" && log.LoginUserName == "admin" && metroTextBox1.Text == log.LoginUserName && metroTextBox2.Text == log.LoginPassword) { user = metroTextBox1.Text; FormMain.ActiveForm.Hide(); new FormAdmin().Show(); metroTextBox1.Clear(); metroTextBox2.Clear(); } if (log.Profile != "ADMIN") { if (log.Profile == "DOCTOR" && metroTextBox1.Text == log.LoginUserName && metroTextBox2.Text == log.LoginPassword) { user = metroTextBox1.Text; FormMain.ActiveForm.Hide(); new FormDoctor().Show(); metroTextBox1.Clear(); metroTextBox2.Clear(); } } if (log.Profile != "ADMIN" && log.Profile != "DOCTOR") { if (log.Profile == "ACCOUNTANT" && metroTextBox1.Text == log.LoginUserName && metroTextBox2.Text == log.LoginPassword) { user = metroTextBox1.Text; FormMain.ActiveForm.Hide(); new FormAccountant().Show(); metroTextBox1.Clear(); metroTextBox2.Clear(); } } if (log.Profile != "ADMIN" && log.Profile != "DOCTOR" && log.Profile != "ACCOUNTANT") { if (log.Profile == "RECEPTIONIST" && metroTextBox1.Text == log.LoginUserName && metroTextBox2.Text == log.LoginPassword) { user = metroTextBox1.Text; FormMain.ActiveForm.Hide(); new FormReceptionist().Show(); metroTextBox1.Clear(); metroTextBox2.Clear(); } } } catch (Exception ex) { MetroMessageBox.Show(this, "Incorrect Username or Password", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); metroTextBox1.Clear(); metroTextBox2.Clear(); } }
public UserControlAdminAddDoctor() { InitializeComponent(); hmsDataContext dbcon = new hmsDataContext(); Department p = new Department(); metroComboBox3.DataSource = dbcon.Departments; metroComboBox3.ValueMember = "DepartmentName"; }
public UserControlReceptionistAddPatient() { InitializeComponent(); hmsDataContext dbcon = new hmsDataContext(); Doctor_ p = new Doctor_(); metroComboBox4.DataSource = dbcon.Doctor_s; metroComboBox4.ValueMember = "DoctorName"; RoomAvailability(); }
private void metroTextButtonAddDoctorConfirm_Click(object sender, EventArgs e) { try { hmsDataContext dbcon = new hmsDataContext(); Doctor_ dc = new Doctor_(); Login_ lg = new Login_(); Salary_ sl = new Salary_(); Department dp = new Department(); dc.DoctorName = metroTextBox1.Text; dc.DoctorEmail = metroTextBox3.Text; dc.DoctorAddress = metroTextBox6.Text; dc.DoctorPhone = metroTextBox7.Text; dc.DoctorUsername = metroTextBox9.Text; dc.DoctorProfile = metroComboBox1.Text; dc.DoctorGender = metroComboBox2.Text; dc.DoctorAge = metroTextBox5.Text; dc.DoctorSalary = metroTextBox8.Text; lg.LoginPassword = metroTextBox10.Text; lg.LoginUserName = metroTextBox9.Text; lg.Profile = metroComboBox1.Text; sl.Name = metroTextBox1.Text; sl.Salary = metroTextBox8.Text; sl.Profile = metroComboBox1.Text; dc.DoctorDepartmentName = metroComboBox3.Text; dbcon.Doctor_s.InsertOnSubmit(dc); dbcon.Login_s.InsertOnSubmit(lg); dbcon.Salary_s.InsertOnSubmit(sl); dbcon.SubmitChanges(); // MessageBox.Show("Succesfully saved!!"); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); metroTextBox1.Clear(); metroTextBox3.Clear(); metroTextBox5.Clear(); metroTextBox6.Clear(); metroTextBox7.Clear(); metroTextBox8.Clear(); metroTextBox9.Clear(); metroTextBox10.Clear(); metroComboBox1.SelectedItem = null; metroComboBox2.SelectedItem = null; metroComboBox3.SelectedItem = null; } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); metroTextBox9.Clear(); // metroTextBox2.Clear(); } }
public UserControlReceptionistProfile() { InitializeComponent(); metroPanelReceptionistProfileChangePassword.Hide(); hmsDataContext dbcon = new hmsDataContext(); Receptionist_ rec = dbcon.Receptionist_s.SingleOrDefault(x => x.ReceptionistUsername == FormMain.user); metroLabel2.Text = rec.ReceptionistName; metroLabel7.Text = rec.ReceptionistAddress; metroLabel8.Text = rec.ReceptionistPhone; metroLabel10.Text = FormMain.user; }
public UserControlAccountantProfile() { InitializeComponent(); metroPanelAccountantProfileChangePassword.Hide(); hmsDataContext dbcon = new hmsDataContext(); Accountant_ acc = dbcon.Accountant_s.SingleOrDefault(x => x.AccountantUsername == FormMain.user); metroLabel2.Text = acc.AccountantName; metroLabel7.Text = acc.AccountantAddress; metroLabel8.Text = acc.AccountantPhone; metroLabel10.Text = FormMain.user; }
public UserControlDoctorProfile() { InitializeComponent(); metroPanelDoctorProfileChangePassword.Hide(); hmsDataContext dbcon = new hmsDataContext(); Doctor_ doc = dbcon.Doctor_s.SingleOrDefault(x => x.DoctorUsername == FormMain.user); metroLabel2.Text = doc.DoctorName; metroLabel7.Text = doc.DoctorAddress; metroLabel8.Text = doc.DoctorPhone; metroLabel10.Text = FormMain.user; }
public UserControlAdminProfile() { InitializeComponent(); metroPanelAdminProfileChangePassword.Hide(); hmsDataContext dbcon = new hmsDataContext(); Admin_ ad = dbcon.Admin_s.SingleOrDefault(x => x.AdminUsername == FormMain.user); metroLabel2.Text = ad.AdminName; metroLabel7.Text = ad.AdminAddress; metroLabel8.Text = ad.AdminPhone; metroLabel10.Text = FormMain.user; }
private void metroTextButtonAddPatientConfirm_Click(object sender, EventArgs e) { try { hmsDataContext dbcon = new hmsDataContext(); Patient pt = new Patient(); Room rm = new Room(); pt.PatientName = metroTextBox1.Text; pt.PatientAddress = metroTextBox3.Text; pt.PatientPhone = metroTextBox4.Text; pt.PatientBloodGroup = metroComboBox2.Text; pt.PatientDateOfBirth = metroDateTime3.Text; pt.PatientDoctorName = metroComboBox4.Text; pt.PatientGender = metroComboBox3.Text; pt.PatientAge = metroTextBox7.Text; pt.PatientRoomNo = metroComboBox1.Text; pt.PatientDateOfAdmission = metroDateTime1.Text; rm.RoomNo = metroComboBox1.Text; //rm.RoomType = metroComboBox2.Text; /* if (rm.RoomNo == metroComboBox1.Text) * { * rm.RoomDateOfAdmission = metroDateTime1.Text; * }*/ dbcon.Patients.InsertOnSubmit(pt); dbcon.Rooms.InsertOnSubmit(rm); dbcon.SubmitChanges(); // MessageBox.Show("Succesfully saved!!"); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); metroTextBox1.Clear(); metroTextBox3.Clear(); metroTextBox4.Clear(); metroTextBox7.Clear(); metroComboBox1.SelectedItem = null; metroComboBox2.SelectedItem = null; metroComboBox3.SelectedItem = null; metroComboBox4.SelectedItem = null; RoomAvailability(); } catch (Exception ex) { MetroMessageBox.Show(this, "Please insert all section.", "Warning!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation); } }
private void metroTextButtonAddAccountantConfirm_Click(object sender, EventArgs e) { try { hmsDataContext dbcon = new hmsDataContext(); Accountant_ ac = new Accountant_(); Login_ lg = new Login_(); Salary_ sl = new Salary_(); ac.AccountantName = metroTextBox1.Text; ac.AccountantAddress = metroTextBox3.Text; ac.AccountantPhone = metroTextBox4.Text; ac.AccountantUsername = metroTextBox6.Text; ac.AccountantProfile = metroComboBox1.Text; ac.AccountantSalary = metroTextBox5.Text; lg.LoginPassword = metroTextBox7.Text; lg.LoginUserName = metroTextBox6.Text; lg.Profile = metroComboBox1.Text; sl.Name = metroTextBox1.Text; sl.Salary = metroTextBox5.Text; sl.Profile = metroComboBox1.Text; dbcon.Salary_s.InsertOnSubmit(sl); dbcon.Login_s.InsertOnSubmit(lg); dbcon.Accountant_s.InsertOnSubmit(ac); dbcon.SubmitChanges(); // MessageBox.Show("Succesfully saved!!"); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); metroTextBox1.Clear(); metroTextBox3.Clear(); metroTextBox4.Clear(); metroTextBox5.Clear(); metroTextBox6.Clear(); metroTextBox7.Clear(); metroComboBox1.SelectedItem = null; } catch (Exception ex) { MetroMessageBox.Show(this, "Username already exist.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); metroTextBox6.Clear(); } }
public AccountantPatientBillingForm() { InitializeComponent(); hmsDataContext dbcon = new hmsDataContext(); Invoice inv = dbcon.Invoices.SingleOrDefault(x => x.InvoicePatientName == Accountant.UC.UserControlAccountantCreateInvoice.invoice); metroLabel31.Text = Convert.ToString(inv.InvoiceId); metroLabel30.Text = inv.InvoiceDate; metroLabel29.Text = Accountant.UC.UserControlAccountantCreateInvoice.invoice; metroLabel28.Text = inv.InvoiceDoctorName; metroLabel27.Text = inv.InvoiceDateOfAdmission; metroLabel26.Text = inv.InvoiceDateOfRelease; metroLabel25.Text = inv.InvoiceAdmissionCharge; metroLabel24.Text = inv.InvoiceServiceCharge; metroLabel23.Text = inv.InvoiceDoctorFees; metroLabel22.Text = inv.InvoiceRoomNo; metroLabel21.Text = inv.InvoiceRoomChargePerDay; metroLabel20.Text = inv.InvoiceRoomNoOfDays; metroLabel19.Text = inv.InvoiceVat; metroLabel18.Text = inv.InvoiceDiscount; metroLabel17.Text = inv.InvoiceTotalBill; }
public UserControlAccountantCreateInvoice() { InitializeComponent(); hmsDataContext dbcon = new hmsDataContext(); /*----------------------------------------------- * Patient pat = dbcon.Patients.SingleOrDefault(x => x.PatientName == metroTextBox3.Text); * if (pat.PatientName == metroTextBox3.Text) * { * //metroComboBox2.DataSource = dbcon.Patients; * //metroComboBox2.ValueMember = "PatientDoctorName"; * metroTextBox8.Text = pat.PatientDoctorName; * * //metroComboBox1.DataSource = dbcon.Rooms; * //metroComboBox1.ValueMember = "PatientRoomNo"; * metroTextBox9.Text = pat.PatientRoomNo; * * metroTextBox10.Text = pat.PatientDateOfAdmission; * * } * //metroComboBox2.DataSource = dbcon.Patients; * //metroComboBox2.ValueMember = "PatientDoctorName"; * * //metroComboBox1.DataSource = dbcon.Rooms; * //metroComboBox1.ValueMember = "PatientRoomNo"; * * //metroDateTime1.Text = "PatientAdmissionDate"; * //--------------------------------------------------*/ Patient p = new Patient(); metroComboBox2.DataSource = dbcon.Doctor_s; metroComboBox2.ValueMember = "DoctorName"; metroComboBox1.DataSource = dbcon.Rooms; metroComboBox1.ValueMember = "RoomNo"; }
private void metroTextButtonReceptionistChangePassword_Click(object sender, EventArgs e) { hmsDataContext dbcon = new hmsDataContext(); if (dbcon.Login_s.Any(x => x.LoginUserName == FormMain.user && x.LoginPassword == metroTextBox2.Text) == true) { if (metroTextBox7.Text.Length < 6) { MetroMessageBox.Show(this, "Please, select a password with at least 6 characters.", "Warning!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation); } else if (metroTextBox7.Text != metroTextBox1.Text) { MetroMessageBox.Show(this, "Password doesn't match.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } else { Login_ lg = new Login_(); lg = dbcon.Login_s.SingleOrDefault(x => x.LoginUserName == FormMain.user); if (lg != null) { lg.LoginUserName = metroLabel10.Text; lg.LoginPassword = metroTextBox1.Text; dbcon.SubmitChanges(); //MetroMessageBox.Show(this, "Your password has been changed successfully. Please login with your new password.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); //this.Dispose(); //FormReceptionist.ActiveForm.Dispose(); //new FormMain().Show(); MetroMessageBox.Show(this, "Your password has been changed successfully. Please restart the application and login with your new password.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Application.Exit(); } } } else { MetroMessageBox.Show(this, "Your password is incorrect.", "Halt!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } }
private void metroTextButtonAddDepartmentConfirm_Click(object sender, EventArgs e) { try { hmsDataContext dbcon = new hmsDataContext(); Department dp = new Department(); dp.DepartmentName = metroTextBox1.Text; dp.DepartmentDescription = metroTextBox3.Text; dbcon.Departments.InsertOnSubmit(dp); dbcon.SubmitChanges(); // MessageBox.Show("Succesfully saved!!"); MetroMessageBox.Show(this, "Succesfully Saved.", "Congratulation", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); metroTextBox1.Clear(); metroTextBox3.Clear(); } catch (Exception ex) { MetroMessageBox.Show(this, "Please insert all section.", "Warning!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation); } }
private void metroTextButtonAddInvoiceConfirm_Click(object sender, EventArgs e) { try { hmsDataContext dbcon = new hmsDataContext(); Invoice inv = new Invoice(); inv.InvoiceDate = metroDateTime3.Text; inv.InvoicePatientName = metroTextBox3.Text; inv.InvoiceRoomNo = metroComboBox1.Text; inv.InvoiceDateOfAdmission = metroDateTime1.Text; inv.InvoiceDateOfRelease = metroDateTime2.Text; inv.InvoiceDoctorName = metroComboBox2.Text; inv.InvoiceAdmissionCharge = metroTextBox4.Text; inv.InvoiceServiceCharge = metroTextBox1.Text; inv.InvoiceDoctorFees = metroTextBox2.Text; inv.InvoiceRoomChargePerDay = metroTextBox6.Text; inv.InvoiceRoomNoOfDays = metroTextBox5.Text; //---------delete room no and room type----------------// String rmm = metroComboBox1.Text; var bills = from b in dbcon.Rooms where b.RoomNo == rmm select b; dbcon.Rooms.DeleteAllOnSubmit(bills); dbcon.SubmitChanges(); // ------------------------------Billing ---------------------------------// double admissioncharge = Convert.ToDouble(metroTextBox4.Text); double doctorfees = Convert.ToDouble(metroTextBox2.Text); double servicecharge = Convert.ToDouble(metroTextBox1.Text); double count = Convert.ToDouble(metroTextBox5.Text); double roomcharge = Convert.ToDouble(metroTextBox6.Text); double discount = Convert.ToDouble(metroTextBox7.Text); double resultWithoutVat, vat, discountMoney, result; resultWithoutVat = admissioncharge + doctorfees + servicecharge + (count * roomcharge); vat = (resultWithoutVat * 15) / 100; result = resultWithoutVat + vat; discountMoney = (result * discount) / 100; double bill = result - discountMoney; //metroTextBox8.Text = Convert.ToString(bill); inv.InvoiceVat = Convert.ToString(vat); inv.InvoiceDiscount = Convert.ToString(discountMoney); inv.InvoiceTotalBill = Convert.ToString(bill); dbcon.Invoices.InsertOnSubmit(inv); dbcon.SubmitChanges(); MetroMessageBox.Show(this, "Your Invoice has been generated and Patient Data from Room has cleared Succesfully. To see the bllling form, press 'OK'.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); invoice = metroTextBox3.Text; //FormMain.ActiveForm.Hide(); new AccountantPatientBillingForm().Show(); metroTextBox4.Clear(); metroTextBox2.Clear(); metroTextBox1.Clear(); metroTextBox5.Clear(); metroTextBox6.Clear(); metroTextBox7.Clear(); metroTextBox3.Clear(); metroComboBox1.SelectedItem = null; metroComboBox2.SelectedItem = null; //MetroMessageBox.Show(this, "Your Invoice has been generated and Patient Data from Room has cleared Succesfully and total bill is " + bill + " TK.", "Congratulation!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } catch (Exception ex) { MetroMessageBox.Show(this, "Please insert all required section.", "Warning!!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation); } }
public void RoomAvailability() { hmsDataContext dbcon = new hmsDataContext(); Room r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "101 (STANDARD-1)"); if (r != null) { metroComboBox1.Items.Remove("101 (STANDARD-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "102 (STANDARD-2)"); if (r != null) { metroComboBox1.Items.Remove("102 (STANDARD-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "103 (STANDARD-3)"); if (r != null) { metroComboBox1.Items.Remove("103 (STANDARD-3)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "104 (STANDARD-4)"); if (r != null) { metroComboBox1.Items.Remove("104 (STANDARD-4)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "105 (STANDARD-5)"); if (r != null) { metroComboBox1.Items.Remove("105 (STANDARD-5)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "106 (STANDARD-6)"); if (r != null) { metroComboBox1.Items.Remove("106 (STANDARD-6)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "107 (STANDARD-7)"); if (r != null) { metroComboBox1.Items.Remove("107 (STANDARD-7)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "201 (SEMI-PRIVATE-1)"); if (r != null) { metroComboBox1.Items.Remove("201 (SEMI-PRIVATE-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "202 (SEMI-PRIVATE-2)"); if (r != null) { metroComboBox1.Items.Remove("202 (SEMI-PRIVATE-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "203 (SEMI-PRIVATE-3)"); if (r != null) { metroComboBox1.Items.Remove("203 (SEMI-PRIVATE-3)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "204 (SEMI-PRIVATE-4)"); if (r != null) { metroComboBox1.Items.Remove("204 (SEMI-PRIVATE-4)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "205 (SEMI-PRIVATE-5)"); if (r != null) { metroComboBox1.Items.Remove("205 (SEMI-PRIVATE-5)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "206 (SEMI-PRIVATE-6)"); if (r != null) { metroComboBox1.Items.Remove("206 (SEMI-PRIVATE-6)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "301 (PRIVATE-1)"); if (r != null) { metroComboBox1.Items.Remove("301 (PRIVATE-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "302 (PRIVATE-2)"); if (r != null) { metroComboBox1.Items.Remove("302 (PRIVATE-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "303 (PRIVATE-3)"); if (r != null) { metroComboBox1.Items.Remove("303 (PRIVATE-3)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "304 (PRIVATE-4)"); if (r != null) { metroComboBox1.Items.Remove("304 (PRIVATE-4)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "305 (PRIVATE-5)"); if (r != null) { metroComboBox1.Items.Remove("305 (PRIVATE-5)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "401 (DELUXE SUITE-1)"); if (r != null) { metroComboBox1.Items.Remove("401 (DELUXE SUITE-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "402 (DELUXE SUITE-2)"); if (r != null) { metroComboBox1.Items.Remove("402 (DELUXE SUITE-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "403 (DELUXE SUITE-3)"); if (r != null) { metroComboBox1.Items.Remove("403 (DELUXE SUITE-3)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "501 (EMERGENCY ROOM-1)"); if (r != null) { metroComboBox1.Items.Remove("501 (EMERGENCY ROOM-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "502 (EMERGENCY ROOM-2)"); if (r != null) { metroComboBox1.Items.Remove("502 (EMERGENCY ROOM-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "601 (INTENSIVE CARE-1)"); if (r != null) { metroComboBox1.Items.Remove("601 (INTENSIVE CARE-1))"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "602 (INTENSIVE CARE-2)"); if (r != null) { metroComboBox1.Items.Remove("602 (INTENSIVE CARE-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "701 (OPERATION THEATER-1)"); if (r != null) { metroComboBox1.Items.Remove("701 (OPERATION THEATER-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "702 (OPERATION THEATER-2)"); if (r != null) { metroComboBox1.Items.Remove("702 (OPERATION THEATER-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "801 (SURGERY-1)"); if (r != null) { metroComboBox1.Items.Remove("801 (SURGERY-1)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "802 (SURGERY-2)"); if (r != null) { metroComboBox1.Items.Remove("802 (SURGERY-2)"); } r = dbcon.Rooms.SingleOrDefault(x => x.RoomNo == "901 (ICU)"); if (r != null) { metroComboBox1.Items.Remove("901 (ICU)"); } /*---------------------------------type availability------------------------ * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-1"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-2"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-3"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-3"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-4"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-4"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-5"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-5"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-6"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-6"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "STANDARD-7"); * if (r != null) * metroComboBox2.Items.Remove("STANDARD-7"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SEMI-PRIVATE-1"); * if (r != null) * metroComboBox2.Items.Remove("SEMI-PRIVATE-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SEMI-PRIVATE-2"); * if (r != null) * metroComboBox2.Items.Remove("SEMI-PRIVATE-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SEMI-PRIVATE-3"); * if (r != null) * metroComboBox2.Items.Remove("SEMI-PRIVATE-3"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SEMI-PRIVATE-4"); * if (r != null) * metroComboBox2.Items.Remove("SEMI-PRIVATE-4"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SEMI-PRIVATE-5"); * if (r != null) * metroComboBox2.Items.Remove("SEMI-PRIVATE-5"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SEMI-PRIVATE-6"); * if (r != null) * metroComboBox2.Items.Remove("SEMI-PRIVATE-6"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "PRIVATE-1"); * if (r != null) * metroComboBox2.Items.Remove("PRIVATE-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "PRIVATE-2"); * if (r != null) * metroComboBox2.Items.Remove("PRIVATE-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "PRIVATE-3"); * if (r != null) * metroComboBox2.Items.Remove("PRIVATE-3"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "PRIVATE-4"); * if (r != null) * metroComboBox2.Items.Remove("PRIVATE-4"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "PRIVATE-5"); * if (r != null) * metroComboBox2.Items.Remove("PRIVATE-5"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "DELUXE SUITE-1"); * if (r != null) * metroComboBox2.Items.Remove("DELUXE SUITE-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "DELUXE SUITE-2"); * if (r != null) * metroComboBox2.Items.Remove("DELUXE SUITE-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "DELUXE SUITE-3"); * if (r != null) * metroComboBox2.Items.Remove("DELUXE SUITE-3"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "EMERGENCY ROOM-1"); * if (r != null) * metroComboBox2.Items.Remove("EMERGENCY ROOM-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "EMERGENCY ROOM-2"); * if (r != null) * metroComboBox2.Items.Remove("EMERGENCY ROOM-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "INTENSIVE CARE-1"); * if (r != null) * metroComboBox2.Items.Remove("INTENSIVE CARE-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "INTENSIVE CARE-2"); * if (r != null) * metroComboBox2.Items.Remove("INTENSIVE CARE-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "OPERATION THEATER-1"); * if (r != null) * metroComboBox2.Items.Remove("OPERATION THEATER-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "OPERATION THEATER-2"); * if (r != null) * metroComboBox2.Items.Remove("OPERATION THEATER-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SURGERY-1"); * if (r != null) * metroComboBox2.Items.Remove("SURGERY-1"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "SURGERY-2"); * if (r != null) * metroComboBox2.Items.Remove("SURGERY-2"); * r = dbcon.Rooms.SingleOrDefault(x => x.RoomType == "ICU"); * if (r != null) * metroComboBox2.Items.Remove("ICU"); * * //-----------------------------------------------end------------------------*/ }