private void DashBoard_Load(object sender, EventArgs e) { DatabaseOps databaseOps = new DatabaseOps(); roles = databaseOps.getRoles(); if (roles.Contains(Role)) { AdminHomeControl homeControl = new AdminHomeControl(ID); ControlClass.ShowControl(homeControl, Content); //buttonDoctor.Image = (new Bitmap(Image.FromFile(@"C:\Users\User\OneDrive\Desktop\Icons\stethoscope.png"), new Size(32, 32))); buttonDoctor.BackgroundImageLayout = ImageLayout.Stretch; buttonSettings.Hide(); buttonPatient.Hide(); buttonBed.Hide(); } else { DoctorHomeUserControl doctorHomeUserControl = new DoctorHomeUserControl(ID, Departmental_ID); ControlClass.ShowControl(doctorHomeUserControl, Content); buttonBed.Visible = false; //buttonDoctor.Visible = false; //buttonDoctor.Image = (new Bitmap(Image.FromFile(@"C:\Users\User\OneDrive\Desktop\Icons\appointment1.png"), new Size(32, 32))); buttonDoctor.BackgroundImageLayout = ImageLayout.Stretch; } }
public bool ifinpatientalreadyexisted(int pid, DateTime stdate) { DatabaseOps databaseOps = new DatabaseOps(); DataTable dt = new DataTable(); dt = databaseOps.displayInPat(); //for (int i = 0; i < dt.Rows.Count; i++) //{ // if (pid == Convert.ToInt32(dt.Rows[i][1].ToString())) // { // if (stdate > Convert.ToDateTime(dt.Rows[i]["DATE_OF_DIS"])) // { // return true; // } // else // { // return false; // } // } // else // { // return false; // } //} return(true); }
public string getDoctorID(string email) { DatabaseOps databaseOps = new DatabaseOps(); DataTable dataTable = new DataTable(); return(databaseOps.getDoctorID(email)); }
private void buttonDelete_Click(object sender, EventArgs e) { Doctor doctor = new Doctor() { ID = textBoxEMPID.Text, Name = textBoxName.Text, Gender = textBoxGender.Text, Designation = comboBox1.SelectedValue.ToString(), Department = comboBox2.SelectedValue.ToString(), Email = textBoxEmail.Text, Address = textBoxAddress.Text, Tel = textBoxTel.Text, Password = textBoxPass.Text, PricePerAppointment = int.Parse(textboxprice.Text), }; DatabaseOps updateDoc = new DatabaseOps(); updateDoc.update(doctor, "doctorlogin"); textBoxName.ReadOnly = true; textBoxGender.ReadOnly = true; textBoxEmail.ReadOnly = true; textBoxAddress.ReadOnly = true; textBoxTel.ReadOnly = true; textBoxPass.ReadOnly = true; textboxprice.ReadOnly = true; }
public Docappointment(int ID) { InitializeComponent(); this.ID = ID; DatabaseOps doctor = new DatabaseOps(); dataGridViewINP.DataSource = doctor.GetAppointmentofDoctor(this.ID); }
public void display() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dt = new DataTable(); dataGridView1.DataSource = databaseOps.display("DOCTORS"); databaseOps.Showincbx(depcbx, "Department", "DepartmentName"); databaseOps.Showincbx(rolecbx, "DoctorRoles", "Rolename"); }
public void display() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dt = new DataTable(); dataGridView1.DataSource = databaseOps.display("EMPLOYEE"); databaseOps.Showincbx(depcbx, "Department", "DepartmentName"); databaseOps.Showincbx(rolecbx, "EmployeeRoles", "RoleName"); }
public void DoctorList() { comboBoxDoctor.Items.Clear(); DatabaseOps databaseOps = new DatabaseOps(); comboBoxDoctor.DataSource = databaseOps.doctorList();; comboBoxDoctor.DisplayMember = "DOC_NAME"; comboBoxDoctor.ValueMember = "ID"; }
public void TimeSlotlist() { //comboBoxslots.Items.Clear(); DatabaseOps databaseOps = new DatabaseOps(); comboBoxslots.DataSource = databaseOps.timeslotlist(Convert.ToInt32(comboBoxDoctor.SelectedValue.ToString()));; comboBoxslots.DisplayMember = "slotdec"; comboBoxslots.ValueMember = "id"; }
public void departmentList() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dataTable = new DataTable(); dataTable = databaseOps.DepartmentList(); comboBox2.DataSource = dataTable; comboBox2.ValueMember = "ID"; comboBox2.DisplayMember = "DepartmentName"; }
public void patientList() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dataTable = new DataTable(); dataTable = databaseOps.patientList(); comboBoxPatient.DataSource = dataTable; comboBoxPatient.DisplayMember = "PAT_NAME"; comboBoxPatient.ValueMember = "ID"; }
public void doctorList() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dataTable = new DataTable(); dataTable = databaseOps.doctorList(); comboBoxDOCID.DataSource = dataTable; comboBoxDOCID.ValueMember = "ID"; comboBoxDOCID.DisplayMember = "DOC_NAME"; }
public void RolesList() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dataTable = new DataTable(); dataTable = databaseOps.RoleList(); comboBox1.DataSource = dataTable; comboBox1.ValueMember = "ID"; comboBox1.DisplayMember = "Rolename"; }
public void roomList() { DatabaseOps databaseOps = new DatabaseOps(); DataTable dataTable = new DataTable(); dataTable = databaseOps.roomList(comboBoxRType.Text); comboBoxRNo.DataSource = dataTable; comboBoxRNo.ValueMember = "ID"; comboBoxRNo.DisplayMember = "ID"; }
private void buttonRoomDelete_Click(object sender, EventArgs e) { if (textBoxRoomID.Text.Length != 0) { DatabaseOps databaseOps = new DatabaseOps(); databaseOps.delete("ROOM", textBoxRoomNo.Text); display(); } else { MessageBox.Show("Unable to delete Data, Select a row which you want to delete", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void comboBoxSearchBy_SelectedIndexChanged_1(object sender, EventArgs e) { if (comboBoxSearchBy.SelectedItem.ToString() == "Current Appointments") { DatabaseOps doctor = new DatabaseOps(); dataGridViewINP.DataSource = doctor.GetAppointmentofDoctor(this.ID, "Current Appointment"); } else { DatabaseOps doctor = new DatabaseOps(); dataGridViewINP.DataSource = doctor.GetAppointmentofDoctor(this.ID); } }
private void button1_Click(object sender, EventArgs e) { Appointment appointment = new Appointment(); appointment.AppointmentDate = dateTimePicker1.Value; appointment.TimeslotID = Convert.ToInt32(comboBoxslots.SelectedValue.ToString()); appointment.DoctorID = Convert.ToInt32(comboBoxDoctor.SelectedValue.ToString()); appointment.PatientID = Convert.ToInt32(comboBoxpatient.SelectedValue.ToString()); DatabaseOps insert = new DatabaseOps(); insert.insert(appointment); insert.updatetimeslotavailability(appointment.TimeslotID, 0); display(); }
private void buttonDelete_Click(object sender, EventArgs e) { if (textBoxid.Text.Length != 0) { DatabaseOps databaseOps = new DatabaseOps(); DatabaseOps db = new DatabaseOps(); databaseOps.DeleteTimeSlots(DoctorID); db.delete("DOCTORS", textBoxid.Text); display(); } else { MessageBox.Show("Unable to delete Data, Select a row which you want to delete", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonInsert_Click(object sender, EventArgs e) { Doctor doctor = new Doctor(); doctor.Name = textBoxName.Text; doctor.Gender = comboBoxGender.Text; doctor.Designation = textBoxDesignation.Text; doctor.Department = textBoxDepartment.Text; doctor.Email = textBoxEmail.Text; doctor.Address = textBoxAddress.Text; doctor.Tel_No = textBoxTel.Text; DatabaseOps insertDoc = new DatabaseOps(); insertDoc.insert(doctor); }
private void button1_Click(object sender, EventArgs e) { if (textBoxPass.Text.Length != 0 && textBoxUsername.Text.Length != 0) { UserLogin login = new UserLogin(); login.Username = textBoxUsername.Text; login.Pass = textBoxPass.Text; DatabaseOps databaseOps = new DatabaseOps(); databaseOps.login(login, "doctorLogin"); } else { textboxError.Visible = true; button1.BackColor = Color.FromArgb(textboxError.ForeColor.ToArgb()); } }
private void buttonPATUpdate_Click(object sender, EventArgs e) { Patient patient = new Patient() { Name = textBoxPATName.Text, Gender = comboBoxPATGender.Text, Tel = textBoxPATTel.Text, DocCode = int.Parse(comboBoxDOCID.Text), Email = textBoxPATEmail.Text, Address = textBoxPATAddress.Text, }; DatabaseOps databaseOps = new DatabaseOps(); databaseOps.insert(patient); display(); }
private void buttonRoomUpdate_Click(object sender, EventArgs e) { Inpatient inpatient = new Inpatient() { PatID = int.Parse(comboBoxPatient.SelectedValue.ToString()), InPatID = int.Parse(textBoxInpatientID.Text), RoomNo = comboBoxRNo.SelectedValue.ToString(), Admission = dateTimePickerDOA.Value.Date, Discharge = dateTimePickerDOD.Value.Date, TotalAmount = int.Parse(textBox1.Text), }; DatabaseOps databaseOps = new DatabaseOps(); databaseOps.update(inpatient); display(); }
private void buttonInsert_Click(object sender, EventArgs e) { Laboratory laboratory = new Laboratory() { Name = textBoxLABName.Text, Gender = comboBoxLABGender.Text, Email = textBoxLABEmail.Text, Tel = textBoxLABTel.Text, Address = textBoxLABAddress.Text, testfor = comboBoxLABTEST.Text }; DatabaseOps insetlab = new DatabaseOps(); insetlab.insert(laboratory); display(); }
private void buttonCancelAppointment_Click(object sender, EventArgs e) { if (textBoxAppointmentID.Text.Length != 0) { DatabaseOps databaseOps = new DatabaseOps(); int oldslotid = databaseOps.gettimeslotidfromappointment(textBoxAppointmentID.Text); databaseOps.updatetimeslotavailability(oldslotid, 1); databaseOps.delete("APPOINTMENT", textBoxAppointmentID.Text); display(); } else { MessageBox.Show("Unable to Cancel Appointment, Select a row which you want to Cancel", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonReschedule_Click(object sender, EventArgs e) { Appointment appointment = new Appointment(); appointment.AppointmentID = textBoxAppointmentID.Text; appointment.AppointmentDate = Convert.ToDateTime(dateTimePicker1.Value.ToString("yyyy-MM-dd")); appointment.TimeslotID = Convert.ToInt32(comboBoxslots.SelectedValue.ToString()); appointment.DoctorID = Convert.ToInt32(comboBoxDoctor.SelectedValue.ToString()); appointment.PatientID = Convert.ToInt32(comboBoxpatient.SelectedValue.ToString()); DatabaseOps update = new DatabaseOps(); int oldslotid = update.gettimeslotidfromappointment(appointment.AppointmentID); update.updatetimeslotavailability(oldslotid, 1); update.update(appointment); update.updatetimeslotavailability(appointment.TimeslotID, 0); display(); }
private void buttonInsert_Click(object sender, EventArgs e) { Doctor doctor = new Doctor() { Name = textBoxName.Text, Gender = comboBoxGender.Text, Designation = textBoxDesignation.Text, Department = textBoxDepartment.Text, Email = textBoxEmail.Text, Address = textBoxAddress.Text, Tel = textBoxTel.Text }; DatabaseOps insertDoc = new DatabaseOps(); insertDoc.insert(doctor); display(); }
private void buttonPATInsert_Click(object sender, EventArgs e) { Patient patient = new Patient() { Name = textBoxPATName.Text, Gender = comboBoxPATGender.Text, Tel = textBoxPATTel.Text, CreatedBy = int.Parse(employeeid.Text), Date = dateTimePicker1.Value, Email = emailt.Text, Address = textBoxPATAddress.Text, }; DatabaseOps databaseOps = new DatabaseOps(); databaseOps.insert(patient); display(); }
private void buttonUpdate_Click(object sender, EventArgs e) { Laboratory lab1 = new Laboratory() { ID = textBoxLABid.Text, Name = textBoxLABName.Text, Gender = comboBoxLABGender.Text, Email = textBoxLABEmail.Text, Tel = textBoxLABTel.Text, Address = textBoxLABAddress.Text, testfor = comboBoxLABTEST.Text }; DatabaseOps updatelab = new DatabaseOps(); updatelab.update(lab1); display(); }
private void buttonInsert_Click(object sender, EventArgs e) { Employee doctor = new Employee() { Name = textBoxName.Text, Gender = comboBoxGender.Text, Designation = rolecbx.SelectedItem.ToString(), Department = depcbx.SelectedItem.ToString(), Pass = password.Text, Email = textBoxEmail.Text, Address = textBoxAddress.Text, Tel = textBoxTel.Text }; DatabaseOps insertemp = new DatabaseOps(); insertemp.insert(doctor); display(); }
private void buttonUpdate_Click(object sender, EventArgs e) { Doctor doctor1 = new Doctor() { ID = textBoxid.Text, Name = textBoxName.Text, Gender = comboBoxGender.Text, Designation = textBoxDesignation.Text, Department = textBoxDepartment.Text, Email = textBoxEmail.Text, Address = textBoxAddress.Text, Tel = textBoxTel.Text }; DatabaseOps updateDoc = new DatabaseOps(); updateDoc.update(doctor1); display(); }