private void GetNextReceiptNumber() { long receiptNumber = new InjectionLabTestBLL().GetNexReceiptNumber(); this.txtIssueNumber.Text = receiptNumber.ToString("0000"); rm.RecieveNumber = receiptNumber; }
private void tsSave_Click(object sender, EventArgs e) { PatientRegistration pr = new PatientRegistration(); try { // pr.TokenDate = System.DateTime.Today; pr.TokenDate = System.DateTime.Now; int num = 0; List <InjectionLabTest> ilt = new List <InjectionLabTest>(); ilt = new InjectionLabTestBLL().GetTokenNum(pr.TokenDate); pr.TokenNumber = Convert.ToInt64(this.lblCurrentTokenNumber.Text.Trim()); // pr.TokenNumber = ilt[0].TokenNumber+1; pr.TokenType = (rbGeneral.Checked) ? TokenType.General : (rbPoor.Checked) ? TokenType.Poor : TokenType.Private; //pr.TokenType = (rbGeneral.Checked) ? TokenType.General : TokenType.Private;------------------->>>>>>>>> pr.CashReceived = Convert.ToDouble(this.txtCashRecieved.Text.Trim()); pr.Patient.FirstName = this.txtPatientFirstName.Text; pr.Patient.LastName = this.txtPatientLastName.Text; pr.Patient.NIC = this.txtPatientCNIC.Text; pr.Patient.Age = Convert.ToInt16(this.txtPatientAge.Text); pr.Patient.Mobile = this.txtPatientMobile.Text; pr.Patient.RegistrationDate = this.dtpPatientRegistrationDate.Value.Date; pr.Patient.RegistrationNumber = this.txtPateintRegistrationNumber.Text; pr.Patient.Address = this.txtPatientAddress.Text; pr.TokenMonthYear = Convert.ToInt64(DateTime.Today.Month.ToString() + DateTime.Today.Year.ToString()); string BranchCode = ConfigurationManager.AppSettings["BranchCode"].ToString(); pr.Patient.RegistrationNumber = BranchCode; pr.TokenBy = IsLoginUser; if (this.lstRooms.SelectedItem != null) { pr.Room = (Room)this.lstRooms.SelectedItem; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Patient Registration Data"); } try { if (pbll.SavePatientToken(pr)) { PrintPreview(false, pr); GetNextTokenNumber(); NewPatient(); MessageBox.Show("Patient Registered Successfully", "Token Granted"); this.txtPatientFirstName.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Save Patient Registration Error"); } // } }
private void frmMedicineIssuedRecord_Load(object sender, EventArgs e) { if (Current != null) { PatientRegistration pr = new InjectionLabTestBLL().GetPatientRegistration(Current); txtPatientRegistrationNumber.Text = pr.Patient.RegistrationNumber; txtPatientName.Text = pr.Patient.FirstName; this.txtPatientName.Text = pr.Patient.FirstName + " " + Current.Patient.LastName; this.txtPatientRegistrationNumber.Text = pr.Patient.RegistrationNumber; this.txtPatientDetails.Text += "CNIC #:" + pr.Patient.NIC + Environment.NewLine; this.txtPatientDetails.Text += "Address :" + pr.Patient.Address + Environment.NewLine; this.txtPatientDetails.Text += "Type :" + pr.TokenType.ToString() + Environment.NewLine; lblToken.Text = pr.TokenNumber.ToString(); lblReg.Text = pr.Patient.RegistrationNumber.ToString(); labtests = new InjectionLabTestBLL().GetMedicineIssued2(pr); for (int i = 0; i < labtests.Count; i++) { LabTest lbt = new LabTest(); lbt = labtests[i]; int switchCase = Convert.ToInt32(lbt.TimesADay); string caseString = ""; switch (switchCase) { case 1: caseString = "od"; break; case 2: caseString = "bd"; break; case 3: caseString = "tds"; break; default: break; } if (lbt.IsAlwaysPaid == true) { caseString += " : " + strAlwaysPaid; Verified = false; } else if (lbt.IsRsTenInjection == true) { caseString += " : " + strInjection; Verified = false; } lstLabTest.Items.Add(lbt.TestName + " : " + caseString); } } }
private void btnOk_Click(object sender, EventArgs e) { if (Reprint == true) { Int64 tNo = 0, mYNo = 0; Int64.TryParse(txtTokenNo.Text, out tNo); InjectionLabTestBLL inLabBll = new InjectionLabTestBLL(); PatientRegistration pr = inLabBll.GetPatientRegistration(new PatientRegistration(tNo, Convert.ToInt64(dateTimePicker1.Value.Month + "" + dateTimePicker1.Value.Year))); if (pr.Patient.RegistrationNumber != null && pr.Patient.RegistrationNumber != "") { this.pr = pr; this.Close(); } else { MessageBox.Show("Invalid token no. for selected month and year"); txtTokenNo.Text = "0"; } } else { Int64 tNo = 0, mYNo = 0; Int64.TryParse(txtTokenNo.Text, out tNo); InjectionLabTestBLL inLabBll = new InjectionLabTestBLL(); InjectionLabTest inLb = inLabBll.GetInjectionLabTest(new InjectionLabTest(tNo, Convert.ToInt64(dateTimePicker1.Value.Month + "" + dateTimePicker1.Value.Year))); if (inLb.Patient.RegistrationNumber != null && inLb.Patient.RegistrationNumber != "") { this.inLb = inLb; this.Close(); } else { MessageBox.Show("Invalid token no. for selected month and year"); } } if (doctor) { Int64 tNo = 0, mYNo = 0; Int64.TryParse(txtTokenNo.Text, out tNo); InjectionLabTestBLL inLabBll = new InjectionLabTestBLL(); InjectionLabTest inLb = inLabBll.GetInjectionLabTest(new InjectionLabTest(tNo, Convert.ToInt32(dateTimePicker1.Value.Month + "" + dateTimePicker1.Value.Year))); PatientRegistration pr = inLabBll.GetPatientRegistration(new PatientRegistration(tNo, Convert.ToInt32(dateTimePicker1.Value.Month + "" + dateTimePicker1.Value.Year))); if (pr.Patient.RegistrationNumber != null && pr.Patient.RegistrationNumber != "") { this.pr = pr; this.inLb = inLb; this.Close(); } else { MessageBox.Show("Invalid token no. for selected month and year"); txtTokenNo.Text = "0"; } } }
private void LoadLabTests(PatientRegistration pr) { this.lbxLabTest.Items.Clear(); List <LabTest> labs = new InjectionLabTestBLL().GetLabTestAssigned(pr); pr.LabTests = labs; if (pr.LabTests.Count > 0) { foreach (LabTest lbt in pr.LabTests) { this.lbxLabTest.Items.Add(lbt); } } }
private void PrintPreview(bool Privew) { DSIssueBill.DTIssueBillDataTable ds = new InjectionLabTestBLL().PrintIssueMedBill(r, rbRetail.Checked, rbPurchase.Checked); crp.SetDataSource((DataTable)ds); FrmReportViewer frmViewer = new FrmReportViewer(); frmViewer.crystalReportViewer1.ReportSource = crp; if (Privew) { frmViewer.ShowDialog(); } else { frmViewer.crystalReportViewer1.RefreshReport(); frmViewer.crystalReportViewer1.PrintReport(); } }
// LabTestRemarks ltRem = new LabTestRemarks(); private void DataGridViewPopulate(PatientRegistration pr) { long nextTokenNumber = pr.TokenNumber; this.lblCurrentTokenNumber.Text = nextTokenNumber.ToString("00000"); this.lblToDate.Text = pr.TokenDate.ToShortDateString(); PatientRegistration prNew = new InjectionLabTestBLL().GetPatientRegistrationLab(pr); PopulatePatientDetails(prNew); this.lstLabTest.Items.Clear(); List <LabTest> labs = new InjectionLabTestBLL().GetLabTestAssigned(prNew); prNew.LabTests = labs; if (prNew.LabTests.Count > 0) { foreach (LabTest lbt in prNew.LabTests) { this.lstLabTest.Items.Add(lbt); } } }
private void tsSave_Click(object sender, EventArgs e) { if (txtCashRecievedByUser.Text == "") { MessageBox.Show("First Enter Received Amount"); return; } InjectionLabTest inLb = new InjectionLabTest(); //inLb.TokenDate = System.DateTime.Today; inLb.TokenDate = System.DateTime.Now; GetNextTokenNumber3nd(); inLb.TokenNumber = Convert.ToInt64(this.lblThirdMainToken.Text.Trim()); inLb.IsInjectionToken = false; if (rbThirdGeneral.Checked == true) { inLb.Type = PatientPayType.General; } else if (rbThirdPoor.Checked == true) { inLb.Type = PatientPayType.Poor; } else if (rbThirdYCDO.Checked == true) { inLb.Type = PatientPayType.YCOD; } if (lbxPaidMedicine.Items.Count > 0) { // foreach (LabTest item in this.lbxPaidMedicine.Items) foreach (LabTest item in alwaysPaid) { inLb.Tests.Add(item); } } if (lbxInjection.Items.Count > 0) { foreach (LabTest item in this.lbxInjection.Items) { inLb.Injections.Add(item); } if (chxSyringThird.Checked) { defaultSyring.CurrentAmount = 0; inLb.Injections.Add(defaultSyring); } } if (lbxLabTest.Items.Count > 0) { foreach (LabTest item in this.lbxLabTest.Items) { inLb.AssignedLabTest.Add(item); } } if (lbxFreeMedicine.Items.Count > 0) { foreach (LabTest item in free) { inLb.Tests.Add(item); } } Int64 exTokNo = 0; Int64.TryParse(txtThirdExistingToken.Text, out exTokNo); inLb.ExistingTokenNo = exTokNo; inLb.CashReceived = Convert.ToDouble(this.txtThirdCashReceived.Text.Trim()); inLb.CashReceivedByUser = Convert.ToDouble(this.txtCashRecievedByUser.Text); inLb.Patient.FirstName = this.txtThirdFirstName.Text; inLb.Patient.LastName = this.txtThirdLastName.Text; inLb.Patient.NIC = this.txtThirdCNIC.Text; inLb.Patient.Mobile = this.txtThirdMobile.Text; inLb.Patient.Age = Convert.ToInt16(this.txtThirdAge.Text); inLb.Patient.RegistrationDate = this.dtpThirdPatientRegistrationDate.Value.Date; inLb.Patient.RegistrationNumber = this.txtThirdPatientRegistrationNumber.Text; inLb.Patient.Address = this.txtThirdAddress.Text; inLb.TokenMonthYear = Convert.ToInt64(DateTime.Today.Month.ToString() + DateTime.Today.Year.ToString()); inLb.TokenBy = IsloginUser; inLb.Room.Name = frm3rd.pr.Room.Name; inLb.Room.LabelName = frm3rd.pr.Room.LabelName; try { GetNextTokenNumber3nd(); //if (inLabBll.SavePatientTokenInjandLabTest(inLb)) // if (inLabBll.SavePatientTokenInjandLabTest(inLb)) { // if (inLb.Injections.Count > 0) // new InjectionLabTestBLL().SetPharmacyIssued(inLb.Injections); //if (inLb.Tests.Count > 0) // new InjectionLabTestBLL().SetPharmacyIssued(inLb.Tests); // if (inLb.AssignedLabTest.Count > 0) // new InjectionLabTestBLL().SetPaidLabTest(inLb.AssignedLabTest); //GetNextTokenNumber3nd(); //ClearThidTurnControls(); //MessageBox.Show("Patient Registered Successfully", "Token Granted"); ///new code starts /// // InjectionLabTest inLb = new InjectionLabTest(); inLb.IsInjectionToken = false; if (rbThirdGeneral.Checked == true) { inLb.Type = PatientPayType.General; } else if (rbThirdPoor.Checked == true) { inLb.Type = PatientPayType.Poor; } else if (rbThirdYCDO.Checked == true) { inLb.Type = PatientPayType.YCOD; } //if (lbxPaidMedicine.Items.Count > 0) //{ // foreach (LabTest item in medications) // { // inLb.Tests.Add(item); // } //} //Int64 exTokNo = 0; Int64.TryParse(txtThirdExistingToken.Text, out exTokNo); inLb.ExistingTokenNo = exTokNo; inLb.TokenNumber = Convert.ToInt32(this.lblThirdMainToken.Text); inLb.CashReceived = Convert.ToDouble(this.txtThirdCashReceived.Text.Trim()); inLb.Patient.FirstName = this.txtThirdFirstName.Text; inLb.Patient.LastName = this.txtThirdLastName.Text; inLb.Patient.NIC = this.txtThirdCNIC.Text; inLb.Patient.Mobile = this.txtThirdMobile.Text; inLb.Patient.Age = Convert.ToInt16(this.txtThirdAge.Text); inLb.Patient.RegistrationDate = this.dtpThirdPatientRegistrationDate.Value.Date; inLb.TokenDate = System.DateTime.Now; inLb.Patient.RegistrationNumber = this.txtThirdPatientRegistrationNumber.Text; //inLb.Patient.Address = this.txtPatientAddress2nd.Text; inLb.TokenMonthYear = Convert.ToInt64(DateTime.Today.Month.ToString() + DateTime.Today.Year.ToString()); inLb.TokenBy = IsloginUser; inLb.Room.Name = frm3rd.pr.Room.Name; inLb.Room.LabelName = frm3rd.pr.Room.LabelName; //if (inLabBll.SavePatientToken(inLb)) ----------- Disable/Change -- Asif - 29-04-19 if (inLabBll.SavePatientTokenInjandLabTest(inLb)) { inLabBll.SetPaidLabTest(inLb.AssignedLabTest); List <LabTest> labtests = new List <LabTest>(); List <LabTest> pendings = new List <LabTest>(); labtests = new InjectionLabTestBLL().GetMedicineIssued(prCancel); pendings = labtests.Where(pen => pen.IsRsTenInjection == true || pen.IsAlwaysPaid == true).ToList <LabTest>(); //new InjectionLabTestBLL().SetPaidLabTest(pendings); if (new InjectionLabTestBLL().SetPharmacyIssued(pendings) == true) { // pendings = labtests.Where(pen => pen.IsRsTenInjection == true || pen.IsAlwaysPaid == true).ToList<LabTest>(); //foreach (LabTest cancelAlwaysPaid in pendings) //{ // new PatientBLL().MedicineCanceled(prCancel, cancelAlwaysPaid); //} ClearThidTurnControls(); } ////////////////---------------------------- Asif - 13-04-19 //foreach (LabTest item in free) //{ // inLb.Tests.Remove(item); //} ////////////////---------------------------- Asif - 13-04-19 PrintPreviewLabandInj(False, inLb); MessageBox.Show("Patient Registered Successfully", "Token Granted"); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Save Patient Registration Error"); } }