private void FillFormData(Guid?id) { try { PatientDetailModel model = service.GetById(id.Value); if (model != null) { PatientDetails frm = new PatientDetails(model.Id); frm.dtpIssueDate.Enabled = true; frm.txtCasePaper.Text = model.CasePaperNumber; frm.dtpIssueDate.Value = model.CasePaperIssuedDate.Value; frm.txtFullName.Text = model.FullName; frm.txtAadharcard.Text = model.AadharCard; frm.txtPanCard.Text = model.PanCard; frm.chkIsDischarged.Checked = model.IsDischarged.HasValue ? model.IsDischarged.Value : false; frm.txtDepartment.Text = model.RoomNumber; frm.txtMobileNumber.Text = model.MobileNumber; frm.txtPhoneNumber.Text = model.PhoneNumber; frm.txtAge.Text = Convert.ToString(model.Age); frm.txtAddress.Text = model.Address; setGender(ref frm, model.Gender.Value); frm.ddlDepartment.SelectedValue = model.DepartmentId.HasValue ? model.DepartmentId : Guid.Empty; frm.ddlRefDoctor.SelectedValue = model.RefferedDoctor.HasValue ? model.RefferedDoctor : Guid.Empty; frm.dtpInTime.Enabled = false; frm.chkCharity.Enabled = false; frm.chkLabCharity.Enabled = false; frm.chkXRay.Enabled = false; frm.chkECG.Enabled = false; frm.txtDischargeAmount.Text = Convert.ToString(model.IPDBillAmount); frm.ShowDialog(); if (isSubmited) { Search(); } isSubmited = false; } } catch (Exception ex) { isSubmited = false; Utility.ErrorLog.Logging("Patient List", ex.InnerException.ToString(), ex.StackTrace.ToString()); } }
private void btnNew_Click(object sender, EventArgs e) { try { PatientDetails frm = new PatientDetails(); frm.ShowDialog(); if (isSubmited) { Search(); } isSubmited = false; } catch (Exception ex) { isSubmited = false; Utility.ErrorLog.Logging("Patient List", ex.Message.ToString(), ex.StackTrace.ToString()); } }