public MessageModel UpdateOutdoorPatient(DAL.Model.OutdoorPatient aOutdoorPatient) { MessageModel aMessageModel = new MessageModel(); aOutdoorPatientGatway = new OutdoorPatientGatway(); //DataTable data = new DataTable(); //data = aOutdoorPatientGatway.IsExist(aOutdoorPatient); //if (data.Rows.Count > 0) //{ // aMessageModel.MessageTitle = "Warning"; // aMessageModel.MessageBody = "This patient already exist. Press the refresh button. \n Thank You."; // return aMessageModel; //} string message = Ischecked(aOutdoorPatient); if (message != "Checked") { aMessageModel.MessageTitle = "Warning"; aMessageModel.MessageBody = message; return(aMessageModel); } if (aOutdoorPatientGatway.UpdateOutdoorPatient(aOutdoorPatient) > 0) { aMessageModel.MessageTitle = "Successful"; aMessageModel.MessageBody = "Outdoor patient information updated successfully."; } return(aMessageModel); }
public MessageModel UpdateAdmissionPatient(Patient patient, DAL.Model.OutdoorPatient aOutdoorPatient) { aIpdGateway = new IpdGateway(); MessageModel aMessageModel = new MessageModel(); int saveCount = 0; OutdoorPatientGatway aOutdoorPatientGatway = new OutdoorPatientGatway(); DataTable data = new DataTable(); data = aOutdoorPatientGatway.IsExist(aOutdoorPatient); if (data.Rows.Count > 0) { saveCount = aIpdGateway.UpdateAdmissionPatient(patient); aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "Indoor patient information updated successfully!"; return(aMessageModel); } else { saveCount = aIpdGateway.UpdateAdmissionPatient(patient); saveCount = new OutdoorPatientGatway().UpdateOutdoorPatient(aOutdoorPatient); aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "Indoor patient information updated successfully!"; } return(aMessageModel); }
public MessageModel SaveOutdoorPatient(DAL.Model.OutdoorPatient aOutdoorPatient) { MessageModel aMessageModel = new MessageModel(); aOutdoorPatientGatway = new OutdoorPatientGatway(); DataTable data = new DataTable(); data = aOutdoorPatientGatway.IsExist(aOutdoorPatient); if (data.Rows.Count > 0) { aMessageModel.MessageTitle = "Warning"; aMessageModel.MessageBody = "This patient already exist. Press the refresh button. \n Thank You."; return(aMessageModel); } string message = Ischecked(aOutdoorPatient); if (message != "Checked") { aMessageModel.MessageTitle = "Warning"; aMessageModel.MessageBody = message; return(aMessageModel); } if (aOutdoorPatientGatway.SaveOutdoorPatient(aOutdoorPatient) > 0) { //int saveCount = new IpdGateway().SavePatientServiceIPD(aOutdoorPatient.AService); aMessageModel.MessageTitle = "Successful"; aMessageModel.MessageBody = "Outdoor patient information saved successfully."; } return(aMessageModel); }
public MessageModel DeleteOutdoorPatient(DAL.Model.OutdoorPatient aOutdoorPatient) { aOutdoorPatientGatway = new OutdoorPatientGatway(); MessageModel aMessageModel = new MessageModel(); if (aOutdoorPatientGatway.DeleteOutdoorPatient(aOutdoorPatient) > 0) { aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "Birth info deleted successfully."; } return(aMessageModel); }
public string Ischecked(DAL.Model.OutdoorPatient aOutdoorPatient) { string message = ""; if (aOutdoorPatient.Opid == string.Empty) { message = "OPID not found, Press the Refresh button.\n Thank You"; } else if (aOutdoorPatient.TreatementType == null) { message = "Please select TreatementType \n Thank You"; } else if (aOutdoorPatient.PatientName == null || aOutdoorPatient.PatientName == "") { message = "Please insert patient name. \n Thank You"; } else if (aOutdoorPatient.GurdianName == null || aOutdoorPatient.GurdianName == "") { message = "Please insert gurdian name. \n Thank You"; } else if (string.IsNullOrEmpty(aOutdoorPatient.Address)) { message = "Please insert address. \n Thank You"; } else if (string.IsNullOrEmpty(aOutdoorPatient.Phone)) { message = "Please insert phone. \n Thank You"; } else if (aOutdoorPatient.Age < 0 || aOutdoorPatient.Age > 150) { message = "Please insert valid age. \n Thank You"; } else if (aOutdoorPatient.BloodGroup == null) { message = "Please select Blood Group. \n Thank You"; } else if (aOutdoorPatient.Gender == null) { message = "Please select Gender. \n Thank You"; } else { message = "Checked"; } return(message); }
public MessageModel SaveIpdPatient(Patient patient, Service service, DAL.Model.OutdoorPatient aOutdoorPatient) { int saveCount = 0; MessageModel aMessageModel = new MessageModel(); string message = Ischecked(patient); if (message != "Checked") { aMessageModel.MessageTitle = "Warning"; aMessageModel.MessageBody = message; return(aMessageModel); } OutdoorPatientGatway aOutdoorPatientGatway = new OutdoorPatientGatway(); DataTable data = new DataTable(); data = aOutdoorPatientGatway.IsExist(aOutdoorPatient); if (data.Rows.Count > 0) { saveCount = new IpdGateway().SaveAdmissionPatient(patient); saveCount = new IpdGateway().SavePatientServiceIPD(service); if (saveCount > 0) { aMessageModel.MessageTitle = "Successful"; aMessageModel.MessageBody = "Indoor patient information saved successfully!"; } return(aMessageModel); } else { saveCount = new IpdGateway().SaveAdmissionPatient(patient); saveCount = new IpdGateway().SavePatientServiceIPD(service); saveCount = new OutdoorPatientGatway().SaveOutdoorPatient(aOutdoorPatient); if (saveCount > 0) { aMessageModel.MessageTitle = "Successful"; aMessageModel.MessageBody = "Indoor patient information saved successfully!"; } return(aMessageModel); } }
private void btnDelete_Click(object sender, EventArgs e) { try { DialogResult dr = MetroFramework.MetroMessageBox.Show(this, "Are you sure to delete row?", "Confirmation Message", MessageBoxButtons.YesNo, MessageBoxIcon.Stop); if (dr == DialogResult.Yes) { DAL.Model.OutdoorPatient aOutdoorPatient = new DAL.Model.OutdoorPatient(); aOutdoorPatient.Opid = txtOpid.Text; MessageModel aMessageModel = new MessageModel(); aMessageModel = aOutdoorPatientManager.DeleteOutdoorPatient(aOutdoorPatient); if (aMessageModel.MessageTitle == "Successfull") { MetroFramework.MetroMessageBox.Show(this, aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); Refresh(); } } } catch (Exception) { //throw; } }
private void btnSave2_Click(object sender, EventArgs e) { try { DAL.Model.OutdoorPatient aOutdoorPatient = new DAL.Model.OutdoorPatient(); aOutdoorPatient.Opid = txtOpid.Text; aOutdoorPatient.ServiceDate = fromDate.Value; if (cmbTreatmentType.Text == "All" || cmbTreatmentType.Text == "IPD" || cmbTreatmentType.Text == "Emergency" || cmbTreatmentType.Text == "Daycare" || cmbTreatmentType.Text == "Consultation") { aOutdoorPatient.TreatementType = cmbTreatmentType.Text; } aOutdoorPatient.PatientName = txtPatientName.Text; aOutdoorPatient.GurdianName = txtGurdianName.Text; aOutdoorPatient.Address = txtAddress.Text; aOutdoorPatient.Phone = txtPhone.Text; if (!string.IsNullOrEmpty(txtAge.Text) && txtAge.Text != "") { aOutdoorPatient.Age = Convert.ToInt32(txtAge.Text); } if (cmbBloodGroup.Text == "A+" || cmbBloodGroup.Text == "A-" || cmbBloodGroup.Text == "AB+" || cmbBloodGroup.Text == "AB-" || cmbBloodGroup.Text == "B+" || cmbBloodGroup.Text == "B-" || cmbBloodGroup.Text == "O+" || cmbBloodGroup.Text == "O-" || cmbBloodGroup.Text == "N/A") { aOutdoorPatient.BloodGroup = cmbBloodGroup.Text; } if (cmbGender.Text == "Female" || cmbGender.Text == "Male" || cmbGender.Text == "Neuture") { aOutdoorPatient.Gender = cmbGender.Text; } aOutdoorPatient.Nationality = cmbNationality.Text; aOutdoorPatient.ContactPerson = txtContactPerson.Text; aOutdoorPatient.Mobile = txtMobileContactPerson.Text; aOutdoorPatient.RefferedBy = string.IsNullOrEmpty(cmbRefferedBy.SelectedValue.ToString()) ? null : cmbRefferedBy.SelectedValue.ToString(); aOutdoorPatient.AService = new Service(); aOutdoorPatient.AService.OPID = txtOpid.Text; aOutdoorPatient.AService.ServiceId = "Serv-02"; if (!string.IsNullOrEmpty(txtDoctorFees.Text)) { aOutdoorPatient.AService.Rate = Convert.ToDouble(txtDoctorFees.Text); } aOutdoorPatient.AService.Qty = 1; aOutdoorPatient.AService.IssueDate = DateTimeServiceDate.Value; aOutdoorPatient.ServiceDate = DateTimeServiceDate.Value; if (searchLookUpDoctor.Properties.View.GetFocusedRowCellValue("DoctorID") != null) { aOutdoorPatient.Doctor = searchLookUpDoctor.Properties.View.GetFocusedRowCellValue("DoctorID").ToString(); } aOutdoorPatient.Fees = txtDoctorFees.Text; if (btnSave2.Text == "Save") { MessageModel aMessageModel = new MessageModel(); aMessageModel = aOutdoorPatientManager.SaveOutdoorPatient(aOutdoorPatient); if (aMessageModel.MessageTitle == "Successful") { MetroFramework.MetroMessageBox.Show(this, aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); Refresh(); } else { MetroFramework.MetroMessageBox.Show(this, aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageModel aMessageModel = new MessageModel(); aMessageModel = aOutdoorPatientManager.UpdateOutdoorPatient(aOutdoorPatient); if (aMessageModel.MessageTitle == "Successful") { MetroFramework.MetroMessageBox.Show(this, aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); Refresh(); } else { MetroFramework.MetroMessageBox.Show(this, aMessageModel.MessageTitle, aMessageModel.MessageBody, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } catch (Exception) { //throw; } }
private void btnEdit_Click(object sender, EventArgs e) { try { DAL.Model.OutdoorPatient aOutdoorPatient = new DAL.Model.OutdoorPatient(); aOutdoorPatient.Opid = txtOpid.Text; aOutdoorPatient.ServiceDate = AdmissionDate.Value; aOutdoorPatient.TreatementType = "IPD"; aOutdoorPatient.PatientName = txtName.Text; aOutdoorPatient.GurdianName = txtGurdian.Text; aOutdoorPatient.Address = txtAddress.Text; aOutdoorPatient.Age = Convert.ToInt32(txtAge.Text); aOutdoorPatient.Phone = txtPhone.Text; aOutdoorPatient.Mobile = txtPhone.Text; aOutdoorPatient.Nationality = txtNationality.Text; //aOutdoorPatient.Doctor = comPrimaryDoctor.Text; aOutdoorPatient.Fees = txtRegFf.Text; aOutdoorPatient.ContactPerson = txtGurdian.Text; aOutdoorPatient.Gender = cmbGender.Text; if (cmbbloodGroup.Text == "A+" || cmbbloodGroup.Text == "A-" || cmbbloodGroup.Text == "AB+" || cmbbloodGroup.Text == "AB-" || cmbbloodGroup.Text == "B+" || cmbbloodGroup.Text == "B-" || cmbbloodGroup.Text == "O+" || cmbbloodGroup.Text == "O-" || cmbbloodGroup.Text == "N/A") { aOutdoorPatient.BloodGroup = cmbbloodGroup.Text; } Patient patient = new Patient(); patient.OPID = txtOpid.Text; patient.PatientName = txtName.Text; patient.FatherName = txtFatherName.Text; patient.MotherName = txtMother.Text; patient.Address = txtAddress.Text; patient.Age = txtAge.Text; patient.Mobile = txtPhone.Text; patient.Gurdian = txtGurdian.Text; patient.Phone = txtPhone.Text; patient.Area = cmbArea.Text; patient.Gender = cmbGender.Text; patient.BloodGroup = cmbbloodGroup.Text; patient.Religion = cmbReligion.Text; patient.RefferedBy = cmbRefferBy.Tag.ToString(); patient.Department = cmbDepartment.Text; patient.Weight = txtWeight.Text; patient.Nationality = txtNationality.Text; patient.InputDate = AdmissionDate.Value; DateTime dt = AdmissionTime.Value; TimeSpan st = new TimeSpan(dt.Hour, dt.Minute, dt.Second); patient.AdmissionTime = st; patient.DutyDoctorId = cmbDutydoctor.SelectedValue.ToString(); patient.Doctor = txtPrimaryDoctor.Text; MessageModel message = new IpdManager().UpdateAdmissionPatient(patient, aOutdoorPatient); if (message.MessageTitle == "Successfull") { MetroFramework.MetroMessageBox.Show(this, message.MessageBody, message.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); Refresh(); GetAllIpdPatient(); LoadData(); } else { MetroFramework.MetroMessageBox.Show(this, message.MessageTitle, message.MessageBody, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception) { //throw; } }
private void btnSave_Click_1(object sender, EventArgs e) { try { //pidSearchLookUpEdit Patient patient = new Patient(); Service service = new Service(); //patient.RefferedBy = cmbRefferBy.SelectedValue.ToString(); DAL.Model.OutdoorPatient aOutdoorPatient = new DAL.Model.OutdoorPatient(); aOutdoorPatient.Opid = txtOpid.Text; aOutdoorPatient.ServiceDate = AdmissionDate.Value; aOutdoorPatient.TreatementType = "IPD"; aOutdoorPatient.PatientName = txtName.Text; aOutdoorPatient.GurdianName = txtGurdian.Text; aOutdoorPatient.Address = txtAddress.Text; if (txtAge.Text != null) { aOutdoorPatient.Age = Convert.ToInt32(txtAge.Text); } aOutdoorPatient.Phone = txtPhone.Text; aOutdoorPatient.Mobile = txtPhone.Text; aOutdoorPatient.Nationality = txtNationality.Text; // aOutdoorPatient.Doctor = comPrimaryDoctor.Text; aOutdoorPatient.Fees = txtRegFf.Text; aOutdoorPatient.ContactPerson = txtGurdian.Text; aOutdoorPatient.Gender = cmbGender.Text; if (cmbbloodGroup.Text == "A+" || cmbbloodGroup.Text == "A-" || cmbbloodGroup.Text == "AB+" || cmbbloodGroup.Text == "AB-" || cmbbloodGroup.Text == "B+" || cmbbloodGroup.Text == "B-" || cmbbloodGroup.Text == "O+" || cmbbloodGroup.Text == "O-" || cmbbloodGroup.Text == "N/A") { aOutdoorPatient.BloodGroup = cmbbloodGroup.Text; } patient.OPID = txtOpid.Text; patient.PatientName = txtName.Text; patient.FatherName = txtFatherName.Text; patient.MotherName = txtMother.Text; patient.Address = txtAddress.Text; patient.Area = cmbArea.Text; patient.Age = txtAge.Text; patient.Area = cmbArea.Text; if (cmbMaritalStatus.Text == "Married" || cmbMaritalStatus.Text == "Single" || cmbMaritalStatus.Text == "Divorced" || txtAge.Text == "Separated" || cmbMaritalStatus.Text == "Widowed") { patient.MaritalStatus = cmbMaritalStatus.Text; } patient.Mobile = txtPhone.Text; patient.Gurdian = txtGurdian.Text; patient.Phone = txtPhone.Text; if (cmbGender.Text == "Male" || cmbGender.Text == "Female" || cmbGender.Text == "Neuture") { patient.Gender = cmbGender.Text; } if (cmbbloodGroup.Text == "A+" || cmbbloodGroup.Text == "A-" || cmbbloodGroup.Text == "AB+" || cmbbloodGroup.Text == "AB-" || cmbbloodGroup.Text == "B+" || cmbbloodGroup.Text == "B-" || cmbbloodGroup.Text == "O+" || cmbbloodGroup.Text == "O-" || cmbbloodGroup.Text == "N/A") { patient.BloodGroup = cmbbloodGroup.Text; } patient.Religion = cmbReligion.Text; patient.RefferedBy = cmbRefferBy.SelectedValue.ToString(); //patient.Doctor = comPrimaryDoctor.Text; patient.Department = cmbDepartment.Text; patient.PatientCondition = txtPatientCondition.Text; patient.RegNo = txtReg.Text; if (chkCabin.Checked == false) { var cabin = cmbwardCabin.SelectedValue; patient.WardOrCabin = cabin.ToString(); } else { var bed = txtseletedBed.SelectedValue; patient.SelectedBed = ""; patient.PatientCondition = txtPatientCondition.Text; if (bed != null) { patient.SelectedBed = bed.ToString(); } } patient.Weight = txtWeight.Text; patient.Nationality = txtNationality.Text; patient.InputDate = AdmissionDate.Value; DateTime dt = AdmissionTime.Value; TimeSpan st = new TimeSpan(dt.Hour, dt.Minute, dt.Second); patient.AdmissionTime = st; patient.DutyDoctorId = cmbDutydoctor.SelectedValue.ToString(); //patient.Doctor = comPrimaryDoctor.Text; patient.RefferedBy = cmbRefferBy.Tag.ToString(); patient.RegNo = txtReg.Text; service.OPID = txtOpid.Text; service.ServiceId = "I-Serv-01"; service.Rate = Convert.ToDouble(txtRegFf.Text); service.Total = Convert.ToDouble(txtRegFf.Text); service.Qty = 1; service.IssueDate = AdmissionDate.Value; service.Catgory = "Hospital"; MessageModel message = new IpdManager().SaveIpdPatient(patient, service, aOutdoorPatient); if (message.MessageTitle == "Successful") { MetroFramework.MetroMessageBox.Show(this, message.MessageBody, message.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); Refresh(); GetAllIpdPatient(); LoadData(); } else { MetroFramework.MetroMessageBox.Show(this, message.MessageBody, message.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception) { //throw; } }