public bool SavePatientComp(PatientComplaintModel model) { try { DBResource newConnection = new DBResource(); newConnection.DBOpen(); SqlCommand comm = new SqlCommand(); comm.Connection = DBResource.conn; comm.CommandText = "dbo.SavePatientComplaint"; comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithValue("@consultaton_id", model.ConsultatonId); comm.Parameters.AddWithValue("@geid", model.geid); comm.Parameters.AddWithValue("@empname", model.EmpName); comm.Parameters.AddWithValue("@complaints", model.Complaints); comm.Parameters.AddWithValue("@created_date", model.CreatedDate); comm.Parameters.AddWithValue("@created_by", model.CreatedBy); comm.Parameters.AddWithValue("@medicine", model.Medicine); comm.Parameters.AddWithValue("@isAgree", model.Agree); comm.Parameters.AddWithValue("@company", model.Company); comm.ExecuteNonQuery(); newConnection.DBClose(); return(true); } catch (Exception ex) { throw ex; } }
public bool SavePatientComplaint(PatientComplaintModel model) { try { _dataAccess.SavePatientComp(model); return(true); } catch (Exception ex) { throw ex; } }
public frmConsultation(PatientComplaintModel patientModel) { InitializeComponent(); if (patientModel.Complaints != "") { string[] words = patientModel.Complaints.Split(','); foreach (string word in words) { listComplaint.Items.Add(word); } } if (patientModel.Medicine != "") { lvMedicine.View = View.Details; lvMedicine.Columns.Add("Medicine", 300); lvMedicine.Columns.Add("Quantity", 100); ListViewItem item; string[] meds = patientModel.Medicine.Split(','); for (int i = 0; i < meds.Length; i++) { string[] arrMed = new string[2]; for (int j = 0; j <= 1; j++) { arrMed[j] = meds[i]; i += 1; } i -= 1; item = new ListViewItem(arrMed); lvMedicine.Items.Add(item); } } disposition = patientModel.disposition; txtEmpName.Text = patientModel.EmpName; txtCompany.Text = patientModel.Company; txtTimeIn.Text = Convert.ToDateTime(patientModel.CreatedDate).ToString(); consultationID = patientModel.ConsultatonId; GEID = patientModel.geid; membercode = patientModel.membercode; //Manipulate Access Role if (clsGlobal.lblrole == "Nurse") { this.Size = new Size(503, 450); groupBox1.Size = new Size(460, 255); } //END }
public void savePatientComp() { PatientComplainBusiness _bll = new PatientComplainBusiness(); var ds = new PatientComplaintModel(); ds.ConsultatonId = Guid.NewGuid().ToString(); ds.LastName = "Guardian"; ds.FirstName = "Kristine"; ds.Complaints = "Head Ache,Migraine"; ds.CreatedDate = DateTime.Now; ds.CreatedBy = "Patient"; ds.Agree = true; _bll.SavePatientComplaint(ds); Assert.AreEqual(true, true); }
public List <PatientComplaintModel> getPatientComplaint() { try { DBResource newConnection = new DBResource(); List <PatientComplaintModel> listModel = new List <PatientComplaintModel>(); PatientComplaintModel PatientComplaintModel; using (SqlConnection myConnection = new SqlConnection(newConnection.connectionString.ToString())) { string query = "dbo.GetMembersPerAccount"; SqlCommand cmd = new SqlCommand(query, myConnection); myConnection.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { PatientComplaintModel = new PatientComplaintModel(); PatientComplaintModel.ConsultatonId = dr["consultaton_id"].ToString() ?? " "; PatientComplaintModel.geid = dr["geid"].ToString() ?? " "; PatientComplaintModel.EmpName = dr["EmployeeName"].ToString() ?? " "; PatientComplaintModel.Complaints = dr["patient_complaints"].ToString() ?? " "; PatientComplaintModel.Medicine = dr["medicine"].ToString() ?? " "; PatientComplaintModel.CreatedDate = Convert.ToDateTime(dr["created_date"]); PatientComplaintModel.Company = dr["company"].ToString() ?? " "; PatientComplaintModel.membercode = dr["membercode"].ToString() ?? " "; PatientComplaintModel.diagnosis = dr["Diagnosis"].ToString() ?? " "; PatientComplaintModel.disposition = dr["Disposition"].ToString() ?? " "; listModel.Add(PatientComplaintModel); } myConnection.Close(); } } return(listModel); } catch (Exception ex) { throw ex; } }
private void dgvPatient_CellClick(object sender, DataGridViewCellEventArgs e) { Cursor.Current = Cursors.Default; //DISABLE CLICKING THE HEADER CODE if (e.RowIndex == -1) { return; } DataGridViewRow row = dgvPatient.Rows[e.RowIndex]; //END if (dgvPatient.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) { PatientComplaintModel listPatientModel = new PatientComplaintModel(); if (dgvPatient.Rows[e.RowIndex].Cells[2].Value.ToString() != null) { listPatientModel.ConsultatonId = dgvPatient.Rows[e.RowIndex].Cells[0].Value.ToString() ?? ""; listPatientModel.geid = dgvPatient.Rows[e.RowIndex].Cells[1].Value.ToString() ?? ""; listPatientModel.membercode = dgvPatient.Rows[e.RowIndex].Cells[2].Value.ToString() ?? ""; listPatientModel.EmpName = dgvPatient.Rows[e.RowIndex].Cells[3].Value.ToString() ?? ""; listPatientModel.Complaints = dgvPatient.Rows[e.RowIndex].Cells[4].Value.ToString() ?? ""; listPatientModel.Medicine = dgvPatient.Rows[e.RowIndex].Cells[5].Value.ToString() ?? ""; listPatientModel.Company = dgvPatient.Rows[e.RowIndex].Cells[7].Value.ToString() ?? ""; listPatientModel.diagnosis = dgvPatient.Rows[e.RowIndex].Cells[8].Value.ToString() ?? ""; listPatientModel.CreatedDate = Convert.ToDateTime(dgvPatient.Rows[e.RowIndex].Cells[13].Value.ToString()); listPatientModel.disposition = dgvPatient.Rows[e.RowIndex].Cells[9].Value.ToString() ?? ""; } frmConsultation frmConsultation = new frmConsultation(listPatientModel); frmConsultation.ShowDialog(); } }