public PatientAmountReceive() { InitializeComponent(); aRefferedInfoManager = new RefferedInfoManager(); amountManager = new RceivedAmountManager(); SetNew(); PopulateGridViewBillCollection(); Control buttonControl = new ButtonPermissionAccess().UserButton(this.panel7, this.Name); }
private void btnSave_Click(object sender, EventArgs e) { ReceivedAmount rcvAmnt = new ReceivedAmount(); rcvAmnt.VoucherNo = int.Parse(txtVoucherNo.Text); rcvAmnt.PatientId = cmbPatientId.Text; rcvAmnt.PatientName = txtPatientName.Text; rcvAmnt.AdmissionDate = dateVoucher.Text; rcvAmnt.BillNo = txtBillNo.Text; rcvAmnt.Inword = lblInward.Text; rcvAmnt.ReceivedBy = MainWindow.userName; if (cmbColType.Text == "Advance" || cmbColType.Text == "Settlement") { rcvAmnt.ColType = cmbColType.Text; } rcvAmnt.PayType = cmbPayType.Text; rcvAmnt.Discount = double.Parse(txtDiscount.Text); rcvAmnt.NetAmount = double.Parse(txtNetAmount.Text); rcvAmnt.Remarks = txtRemarks.Text; rcvAmnt.ReceivedBy = txtRecieveBy.Text; rcvAmnt.RefferedBy = Convert.ToInt32(cmbDiscountBy.Tag); if (rdIndoor.Checked) { rcvAmnt.Status = "InDoor"; } if (rdNICU.Checked) { rcvAmnt.Status = "NICU"; } if (rdOutDoor.Checked) { rcvAmnt.Status = "OutDoor"; } MessageModel message = new RceivedAmountManager().SaveReceivedAmount(rcvAmnt); if (message.MessageTitle == "Successful") { MetroFramework.MetroMessageBox.Show(this, message.MessageBody, message.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); PopulateGridViewBillCollection(); btnRefresh.PerformClick(); } else { MetroFramework.MetroMessageBox.Show(this, message.MessageBody, message.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void cmbPatientId_SelectedIndexChanged(object sender, EventArgs e) { try { string chk = ""; clear(); if (rdIndoor.Checked == true) { chk = "Indoor"; DataTable dtP = new RceivedAmountManager().GetPatientNamebyId(cmbPatientId.Text, chk); txtPatientName.Text = dtP.Rows[0][0].ToString(); if (cmbColType.Text == @"Settlement") { DataTable dt2 = new RceivedAmountManager().GetPatientBillbyId(cmbPatientId.Text, chk); txtBillNo.Text = dt2.Rows[0]["BillNo"].ToString(); txtRemainingBalance.Text = dt2.Rows[0]["NetPayble"].ToString(); txtTotalAmount.Text = dt2.Rows[0]["NetPayble"].ToString(); txtNetAmount.Text = dt2.Rows[0]["NetPayble"].ToString(); cmbPatientId.Focus(); } } else if (rdOutDoor.Checked == true) { chk = "Outdoor"; DataTable dtP = new RceivedAmountManager().GetPatientNamebyId(cmbPatientId.Text, chk); txtPatientName.Text = dtP.Rows[0][0].ToString(); DataTable dt2 = new RceivedAmountManager().GetPatientBillbyId(cmbPatientId.Text, chk); txtBillNo.Text = dt2.Rows[0]["BillNo"].ToString(); txtRemainingBalance.Text = dt2.Rows[0]["NetPayble"].ToString(); txtTotalAmount.Text = dt2.Rows[0]["NetPayble"].ToString(); txtNetAmount.Text = dt2.Rows[0]["NetPayble"].ToString(); cmbPatientId.Focus(); } else if (rdNICU.Checked == true) { chk = "NICU"; DataTable dtP = new RceivedAmountManager().GetPatientNamebyId(cmbPatientId.Text, chk); txtPatientName.Text = dtP.Rows[0][0].ToString(); if (cmbColType.Text == @"Settlement") { DataTable dt2 = new RceivedAmountManager().GetPatientBillbyId(cmbPatientId.Text, chk); txtBillNo.Text = dt2.Rows[0]["BillNo"].ToString(); txtRemainingBalance.Text = dt2.Rows[0]["NetPayble"].ToString(); txtTotalAmount.Text = dt2.Rows[0]["NetPayble"].ToString(); txtNetAmount.Text = dt2.Rows[0]["NetPayble"].ToString(); cmbPatientId.Focus(); } } if (cmbColType.Text == @"Advance") { DataTable dt3 = new DataTable(); DataTable dt = new RceivedAmountManager().GetConsultBill(cmbPatientId.Text); DataTable dt1 = new RceivedAmountManager().GetPharmacyBill(cmbPatientId.Text); DataTable dt2 = new RceivedAmountManager().GetPathologyBill(cmbPatientId.Text); if (rdNICU.Checked) { dt3 = new RceivedAmountManager().GetPatientServiceServiceBillNICU(cmbPatientId.Text); } else { dt3 = new RceivedAmountManager().GetHospitalServiceBill(cmbPatientId.Text); } DataTable dt4 = new RceivedAmountManager().GetOTServiceBill(cmbPatientId.Text); DataTable dt5 = new RceivedAmountManager().GetOTMedicineBill(cmbPatientId.Text); DataTable dt6 = new RceivedAmountManager().GetOPMedicineBill(cmbPatientId.Text); DataTable dt7 = new RceivedAmountManager().GetPatientAdvance(cmbPatientId.Text); double consultBill = 0; double PharmacyBill = 0; double PathologyBill = 0; double HospitalService = 0; double OTService = 0; double OTMedicine = 0; double OPMedicine = 0; double PatientAdvace = 0; if (dt.Rows.Count > 0) { consultBill = Convert.ToDouble(dt.Rows[0]["Subtotal"]); } if (dt1.Rows.Count > 0) { PharmacyBill = Convert.ToDouble(dt1.Rows[0]["Subtotal"]); } if (dt2.Rows.Count > 0) { PathologyBill = Convert.ToDouble(dt2.Rows[0]["Subtotal"]); } if (dt3.Rows.Count > 0) { HospitalService = Convert.ToDouble(dt3.Rows[0]["Subtotal"]); } if (dt4.Rows.Count > 0) { OTService = Convert.ToDouble(dt4.Rows[0]["Subtotal"]); } if (rdIndoor.Checked == true) { if (dt5.Rows.Count > 0) { OTMedicine = Convert.ToDouble(dt5.Rows[0]["Subtotal"]); } } if (rdOutDoor.Checked == true) { if (dt6.Rows.Count > 0) { OTMedicine = Convert.ToDouble(dt6.Rows[0]["Subtotal"]); } } if (dt7.Rows.Count > 0) { PatientAdvace = Convert.ToDouble(dt7.Rows[0]["Subtotal"]); } txtRemainingBalance.Text = ((consultBill + PharmacyBill + PathologyBill + HospitalService + OTService + OTMedicine) - PatientAdvace).ToString("0.00"); txtBillNo.Text = "NA"; txtTotalAmount.Text = txtRemainingBalance.Text; txtDiscount.Text = "0"; cmbPatientId.Focus(); } } catch (Exception) { } }
private void loadPatientID() { int row = 0; try { cmbColType.Enabled = true; DataTable data = new DataTable(); //data.Rows.Clear(); if (rdIndoor.Checked == true) { SetNew(); if (cmbColType.Text == @"Advance") { data.Rows.Clear(); cmbPatientId.DataSource = null; data = new RceivedAmountManager().GetPatientIdFrmIndoorDataTable(); if (data != null && data.Rows.Count > 0) { cmbPatientId.DataSource = data; cmbPatientId.DisplayMember = "OPID"; cmbPatientId.ValueMember = "Id"; data.Rows.Add(); row = data.Rows.Count - 1; data.Rows[row][1] = "---Select---"; cmbPatientId.SelectedIndex = row; } // GridLoad(); } if (cmbColType.Text == @"Settlement") { data.Rows.Clear(); cmbPatientId.DataSource = null; data = new RceivedAmountManager().GetPatientIdFrmDischargeDataTable(); if (data != null && data.Rows.Count > 0) { cmbPatientId.DataSource = data; // data.Rows[row]["OPID"] = "---Select---"; cmbPatientId.DisplayMember = "OPID"; cmbPatientId.ValueMember = "Id"; data.Rows.Add(); row = data.Rows.Count - 1; data.Rows[row][1] = "---Select---"; cmbPatientId.SelectedIndex = row; } //GridLoad(); } } if (rdNICU.Checked == true) { if (cmbColType.Text == @"Advance") { data.Rows.Clear(); cmbPatientId.DataSource = null; data = new RceivedAmountManager().GetPatientIdFrmNICU(); if (data != null && data.Rows.Count > 0) { cmbPatientId.DataSource = data; cmbPatientId.DisplayMember = "RegNo"; cmbPatientId.ValueMember = "Id"; data.Rows.Add(); row = data.Rows.Count - 1; data.Rows[row][1] = "---Select---"; cmbPatientId.SelectedIndex = row; } // GridLoad(); } else if (cmbColType.Text == @"Settlement") { //data.Rows.Clear(); data.Rows.Add(); cmbPatientId.DataSource = null; data = new RceivedAmountManager().GetPatientIdFrmNICUDischargeDataTable(); if (data != null && data.Rows.Count > 0) { cmbPatientId.DataSource = data; // data.Rows[row]["OPID"] = "---Select---"; cmbPatientId.DisplayMember = "OPID"; cmbPatientId.ValueMember = "Id"; row = data.Rows.Count - 1; data.Rows[row][1] = "---Select---"; cmbPatientId.SelectedIndex = row; } //GridLoad(); } } if (rdOutDoor.Checked == true) { //@@@@@@@@@@@@@@@@@@@@@@@@@@@problem SetNew(); cmbColType.Enabled = false; cmbColType.SelectedIndex = 1; data = new RceivedAmountManager().GetPatientIdFrmOurDoorDataTable(); if (data != null && data.Rows.Count > 0) { cmbPatientId.DataSource = data; cmbPatientId.DisplayMember = "OPID"; cmbPatientId.ValueMember = "Id"; //row = data.Rows.Count - 1; //data.Rows[row][1] = "---Select---"; //data.Rows[row][2] = "0"; //cmbPatientId.DisplayMember = "OPID"; //cmbPatientId.ValueMember = "Id"; //cmbPatientId.SelectedIndex = row; } } } catch (Exception) { //cmbPatientId.SelectedIndex = row; } }