public PaymentDetails(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo, ChargesLogic chargesManager) { this.InitializeComponent(); _userInfo = userInfo; _patientInfo = patientInfo; _regInfo = regInfo; _chargesManager = chargesManager; _errProvider = new ErrorProvider(); this.Load += new EventHandler(ClassLoad); this.cboPaymentType.SelectedIndexChanged += new EventHandler(cboPaymentTypeSelectedIndexChanged); this.txtAmountPaid.KeyPress += new KeyPressEventHandler(txtAmountPaidKeyPress); this.txtAmountPaid.Validating += new System.ComponentModel.CancelEventHandler(txtAmountPaidValidating); this.txtAmountPaid.Validated += new EventHandler(txtAmountPaidValidated); this.txtAmountPaid.KeyUp += new KeyEventHandler(txtAmountPaidKeyUp); this.txtDiscount.KeyPress += new KeyPressEventHandler(txtDiscountKeyPress); this.txtDiscount.Validating += new System.ComponentModel.CancelEventHandler(txtDiscountValidating); this.txtDiscount.Validated += new EventHandler(txtDiscountValidated); this.txtDiscount.KeyUp += new KeyEventHandler(txtDiscountKeyUp); this.lnkChange.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkChangeLinkClicked); this.txtBankName.Validated += new EventHandler(txtBankNameValidated); this.txtCheckNo.Validated += new EventHandler(txtCheckNoValidated); this.txtCardNo.Validated += new EventHandler(txtCardNoValidated); this.txtCardType.Validated += new EventHandler(txtCardTypeValidated); this.txtExpiringDate.Validated += new EventHandler(txtExpiringDateValidated); }
//############################################CLASS PatientRegistration EVENTS####################################################### //event is raised when the class is loaded protected virtual void ClassLoad(object sender, EventArgs e) { if (!DatabaseLib.ProcStatic.IsSystemAccessAdmin(_userInfo) && !DatabaseLib.ProcStatic.IsSystemAccessDentalUser(_userInfo)) { DentalLib.ProcStatic.ShowErrorDialog("You are not allowed to access this module.", "Patient Registration"); _hasErrors = true; this.Close(); } else if (!DatabaseLib.ProcStatic.IsSystemAccessAdmin(_userInfo)) { this.lnkChange.Visible = false; } this.lblPatientSysId.Text = _patientInfo.PatientSystemId; this.lblName.Text = _patientInfo.LastName.ToUpper() + ", " + _patientInfo.FirstName + " " + _patientInfo.MiddleName; _regInfo = new CommonExchange.Registration(); _regInfo.PatientSystemId = _patientInfo.PatientSystemId; _regInfo.RegistrationDate = _regManager.ServerDateTime; this.lblDate.Text = DateTime.Parse(_regInfo.RegistrationDate).ToLongDateString(); }
public PatientChargesSummary(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo) { this.InitializeComponent(); _userInfo = userInfo; _patientInfo = patientInfo; _regInfo = regInfo; this.Load += new EventHandler(ClassLoad); this.FormClosed += new FormClosedEventHandler(ClassClosed); this.dgvProcedures.MouseDown += new MouseEventHandler(dgvProceduresMouseDown); this.dgvProcedures.DoubleClick += new EventHandler(dgvProceduresDoubleClick); this.dgvProcedures.KeyPress += new KeyPressEventHandler(dgvProceduresKeyPress); this.dgvProcedures.KeyDown += new KeyEventHandler(dgvProceduresKeyDown); this.dgvProcedures.DataSourceChanged += new EventHandler(dgvProceduresDataSourceChanged); this.dgvProcedures.SelectionChanged += new EventHandler(dgvProceduresSelectionChanged); this.dgvPayments.MouseDown += new MouseEventHandler(dgvPaymentsMouseDown); this.dgvPayments.DoubleClick += new EventHandler(dgvPaymentsDoubleClick); this.dgvPayments.KeyPress += new KeyPressEventHandler(dgvPaymentsKeyPress); this.dgvPayments.KeyDown += new KeyEventHandler(dgvPaymentsKeyDown); this.dgvPayments.DataSourceChanged += new EventHandler(dgvPaymentsDataSourceChanged); this.dgvPayments.SelectionChanged += new EventHandler(dgvPaymentsSelectionChanged); this.btnClose.Click += new EventHandler(btnCloseClick); this.lnkCreateCharges.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkCreateChargesLinkClicked); this.lnkCreatePayment.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkCreatePaymentLinkClicked); this.btnReceipt.Click += new EventHandler(btnReceiptClick); this.lnkPrescription.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkPrescriptionLinkClicked); }
public MedicalPrescription(CommonExchange.SysAccess userInfo, CommonExchange.Registration regInfo) { this.InitializeComponent(); _userInfo = userInfo; _regInfo = regInfo; this.Load += new EventHandler(ClassLoad); this.FormClosing += new FormClosingEventHandler(ClassClosing); this.txtPrescription.Validated += new EventHandler(txtPrescriptionValidated); this.btnClose.Click += new EventHandler(btnCloseClick); this.btnSave.Click += new EventHandler(btnSaveClick); }
} //------------------------------ //this procedure updates a patient registration public void UpdatePatientRegistration(CommonExchange.SysAccess userInfo, CommonExchange.Registration regInfo) { using (SqlCommand sqlComm = new SqlCommand()) { sqlComm.Connection = userInfo.Connection; sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.CommandText = "dental.UpdatePatientRegistration"; sqlComm.Parameters.Add("@sysid_registration", SqlDbType.VarChar).Value = regInfo.RegistrationSystemId; sqlComm.Parameters.Add("@registration_date", SqlDbType.DateTime).Value = DateTime.Parse(regInfo.RegistrationDate); sqlComm.Parameters.Add("@edited_by", SqlDbType.VarChar).Value = userInfo.UserId; sqlComm.ExecuteNonQuery(); } } //------------------------------
//this procedure inserts a new patient registration public void InsertPatientRegistration(CommonExchange.SysAccess userInfo, ref CommonExchange.Registration regInfo) { regInfo.RegistrationSystemId = PrimaryKeys.GetNewSysIDPatientRegistration(userInfo); using (SqlCommand sqlComm = new SqlCommand()) { sqlComm.Connection = userInfo.Connection; sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.CommandText = "dental.InsertPatientRegistration"; sqlComm.Parameters.Add("@sysid_registration", SqlDbType.VarChar).Value = regInfo.RegistrationSystemId; sqlComm.Parameters.Add("@sysid_patient", SqlDbType.VarChar).Value = regInfo.PatientSystemId; sqlComm.Parameters.Add("@registration_date", SqlDbType.DateTime).Value = DateTime.Parse(regInfo.RegistrationDate); sqlComm.Parameters.Add("@created_by", SqlDbType.VarChar).Value = userInfo.UserId; sqlComm.ExecuteNonQuery(); } } //------------------------------
} //---------------------------------- //##########################################END BUTTON btnPrint EVENTS############################################################### #endregion #region Programmer-Defined Void Procedures //this procedure selects the first row in the datagridview protected override void OnDoubleClickEnter(String id) { this.Cursor = Cursors.WaitCursor; CommonExchange.Registration regInfo = _regManager.GetRegistrationDetailsForCashReport(id); CommonExchange.Patient patientInfo = _regManager.SelectByPatientSystemIdPatientInformation(_userInfo, _regManager.GetPatientSystemIdForCashReport(id), Application.StartupPath); using (DentalLib.PatientChargesSummary frmSummary = new PatientChargesSummary(_userInfo, patientInfo, regInfo)) { frmSummary.ShowDialog(this); if (frmSummary.HasUpdated || frmSummary.HasDeleted) { this.SetReportData(); } } this.Cursor = Cursors.Arrow; } //-----------------------
public PatientCharges(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo, ChargesLogic chargesManager) { this.InitializeComponent(); _userInfo = userInfo; _patientInfo = patientInfo; _regInfo = regInfo; _chargesManager = chargesManager; _errProvider = new ErrorProvider(); this.Load += new EventHandler(ClassLoad); this.lnkChange.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkChangeLinkClicked); this.btnSearch.Click += new EventHandler(btnSearchClick); this.txtAmount.KeyPress += new KeyPressEventHandler(txtAmountKeyPress); this.txtAmount.Validating += new System.ComponentModel.CancelEventHandler(txtAmountValidating); this.txtAmount.Validated += new EventHandler(txtAmountValidated); this.txtRemarks.Validated += new EventHandler(txtRemarksValidated); this.txtToothNo.Validated += new EventHandler(txtToothNoValidated); }
public PaymentDetailsUpdate(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo, CommonExchange.PaymentDetails paymentInfo, ChargesLogic chargesManager) : base(userInfo, patientInfo, regInfo, chargesManager) { this.InitializeComponent(); _paymentInfo = paymentInfo; _paymentInfoTemp = paymentInfo; this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnUpdate.Click += new EventHandler(btnUpdateClick); this.btnDelete.Click += new EventHandler(btnDeleteClick); this.btnClose.Click += new EventHandler(btnCloseClick); }
public PatientChargesCreate(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo, ChargesLogic chargesManager) : base(userInfo, patientInfo, regInfo, chargesManager) { this.InitializeComponent(); this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnCreate.Click += new EventHandler(btnCreateClick); this.btnCancel.Click += new EventHandler(btnCancelClick); }
static void Main() { //sets the user information CommonExchange.SysAccess userInfo = new CommonExchange.SysAccess(); //-------------------------- try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Int32 startIndex = 1; if (startIndex == 1) { Boolean hasAccess = false; using (SystemLogIn frmLogIn = new SystemLogIn()) { frmLogIn.ShowDialog(); if (frmLogIn.HasAccess) { hasAccess = true; userInfo = frmLogIn.UserInformation; } } if (hasAccess) { ////gets the user information //using (DatabaseLib.DbLibGeneral dbLib = new DatabaseLib.DbLibGeneral()) //{ // //fail safe block // DateTime serverDateTime; // serverDateTime = DateTime.Parse(dbLib.GetServerDateTime(userInfo.Connection)); // if (DateTime.Compare(serverDateTime, DateTime.Parse("06/30/2008")) >= 0) // { // throw new Exception("The program has encountered a critical error. Please contact the system administrator."); // } // //------------------------------------ //} //-------------------------------- Application.Run(new DentalSystemManager(userInfo)); } } else if (startIndex == 2) { //gets the user information using (DatabaseLib.DbLibGeneral dbLib = new DatabaseLib.DbLibGeneral()) { if (dbLib.AuthenticateUser(ref userInfo)) { Int32 process = 1; if (process == 1) { Application.Run(new DentalSystemManager(userInfo)); } else if (process == 2) { Application.Run(new DentalLib.ProcedureSearchOnTextboxList(userInfo, true)); } else if (process == 3) { Application.Run(new DentalLib.PatientInformationCreate(userInfo)); } else if (process == 4) { Application.Run(new DentalLib.PatientInformationUpdate(userInfo, "SYSPNT000000026")); } else if (process == 5) { DentalLib.ChargesLogic chargesManager = new DentalLib.ChargesLogic(userInfo); CommonExchange.Patient patientInfo = chargesManager.SelectByPatientSystemIdPatientInformation(userInfo, "SYSPNT000000026", Application.StartupPath); CommonExchange.Registration regInfo = new CommonExchange.Registration(); regInfo.RegistrationSystemId = "SYSREG00000001"; regInfo.RegistrationDate = DateTime.Now.ToLongDateString(); Application.Run(new DentalLib.PatientChargesSummary(userInfo, patientInfo, regInfo)); } else if (process == 6) { Application.Run(new DentalLib.ReportsCashReport(userInfo, DateTime.Parse("12/01/2007"), DateTime.Parse("12/31/2007"))); } else if (process == 7) { Application.Run(new DentalLib.ReportsAccountsReceivable(userInfo)); } else if (process == 8) { Application.Run(new DentalLib.UserSearchOnTextboxList(userInfo)); } } } //------------------------- } } catch (Exception err) { DentalLib.ProcStatic.ShowErrorDialog(err.Message, "System Error"); } finally { if (userInfo.Connection != null && userInfo.Connection.State == System.Data.ConnectionState.Open) { userInfo.Connection.Close(); } Application.Exit(); } }
//this procedure prints the receipt public void PrintPatientChargesReceipt(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo) { DataTable regTable = new DataTable("RegistrationTable"); regTable.Columns.Add("sysid_registration", System.Type.GetType("System.String")); DataRow regRow = regTable.NewRow(); regRow["sysid_registration"] = regInfo.RegistrationSystemId; regTable.Rows.Add(regRow); regTable.AcceptChanges(); DataTable procedureTable = new DataTable("ProceduresTakenTable"); procedureTable.Columns.Add("details_id", System.Type.GetType("System.String")); procedureTable.Columns.Add("sysid_registration", System.Type.GetType("System.String")); procedureTable.Columns.Add("date_administered", System.Type.GetType("System.String")); procedureTable.Columns.Add("procedure_name", System.Type.GetType("System.String")); procedureTable.Columns.Add("amount", System.Type.GetType("System.Decimal")); if (_registrationDetailsTable != null) { foreach (DataRow detailsRow in _registrationDetailsTable.Rows) { DataRow newRow = procedureTable.NewRow(); newRow["details_id"] = detailsRow["details_id"].ToString(); newRow["sysid_registration"] = regInfo.RegistrationSystemId; newRow["date_administered"] = "Date Administered: " + DateTime.Parse(detailsRow["date_administered"].ToString()).ToShortDateString() + ((!String.IsNullOrEmpty(DatabaseLib.ProcStatic.DataRowConvert(detailsRow, "tooth_no", ""))) ? " Tooth No: " + DatabaseLib.ProcStatic.DataRowConvert(detailsRow, "tooth_no", "").ToString() : ""); newRow["procedure_name"] = detailsRow["procedure_name"].ToString(); newRow["amount"] = Decimal.Parse(detailsRow["amount"].ToString()); procedureTable.Rows.Add(newRow); } procedureTable.AcceptChanges(); } DataTable paymentTable = new DataTable("PaymentTable"); paymentTable.Columns.Add("receipt_no", System.Type.GetType("System.String")); paymentTable.Columns.Add("sysid_registration", System.Type.GetType("System.String")); paymentTable.Columns.Add("receipt_details", System.Type.GetType("System.String")); paymentTable.Columns.Add("payment_details", System.Type.GetType("System.String")); paymentTable.Columns.Add("discount_details", System.Type.GetType("System.String")); paymentTable.Columns.Add("payment_amount", System.Type.GetType("System.Decimal")); paymentTable.Columns.Add("discount_amount", System.Type.GetType("System.Decimal")); if (_paymentDetailsTable != null) { foreach (DataRow payRow in _paymentDetailsTable.Rows) { DataRow newRow = paymentTable.NewRow(); newRow["receipt_no"] = payRow["receipt_no"].ToString(); newRow["sysid_registration"] = regInfo.RegistrationSystemId; newRow["receipt_details"] = "Date Posted: " + DateTime.Parse(payRow["date_paid"].ToString()).ToShortDateString() + " Receipt No: " + payRow["receipt_no"].ToString(); newRow["payment_details"] = "Amount Paid:" + " " + Decimal.Parse(payRow["amount"].ToString()).ToString("N") + " Discount: " + Decimal.Parse(payRow["discount"].ToString()).ToString("N"); newRow["discount_details"] = "Discount"; newRow["payment_amount"] = Decimal.Parse(payRow["amount"].ToString()) + Decimal.Parse(payRow["discount"].ToString()); paymentTable.Rows.Add(newRow); } paymentTable.AcceptChanges(); } using (DentalLib.ClassPatientRegistrationServices.CrystalReport.CrystalPaymentSummary rptReceipt = new DentalLib.ClassPatientRegistrationServices.CrystalReport.CrystalPaymentSummary()) { CommonExchange.ClinicInformation clinicInfo = new CommonExchange.ClinicInformation(); rptReceipt.Database.Tables["registration_table"].SetDataSource(regTable); rptReceipt.Database.Tables["procedures_table"].SetDataSource(procedureTable); rptReceipt.Database.Tables["payments_table"].SetDataSource(paymentTable); rptReceipt.SetParameterValue("@clinic_name", clinicInfo.ClinicName); rptReceipt.SetParameterValue("@address", clinicInfo.Address); rptReceipt.SetParameterValue("@contact_no", clinicInfo.PhoneNos); rptReceipt.SetParameterValue("@patient_name", patientInfo.LastName.ToUpper() + ", " + patientInfo.FirstName.ToUpper() + " " + patientInfo.MiddleName.ToUpper()); rptReceipt.SetParameterValue("@patient_address", patientInfo.HomeAddress); rptReceipt.SetParameterValue("@patient_age", patientInfo.Age); rptReceipt.SetParameterValue("@registration_no", regInfo.RegistrationSystemId); rptReceipt.SetParameterValue("@registration_date", regInfo.RegistrationDate.ToString()); CommonExchange.PaymentSummary summary = this.GetPaymentSummary(); rptReceipt.SetParameterValue("@total_notice", "Your current balance is >> "); rptReceipt.SetParameterValue("@total_amount", summary.Balance.ToString("N")); rptReceipt.SetParameterValue("@runtime_date", "as of " + DateTime.Parse(s_serverDateTime).ToShortDateString() + " " + DateTime.Parse(s_serverDateTime).ToShortTimeString()); rptReceipt.SetParameterValue("@printed_details", "Prepared by: " + userInfo.LastName + ", " + userInfo.FirstName + " " + userInfo.MiddleName); rptReceipt.SetParameterValue("@approved_details", "Approved by: " + clinicInfo.ApprovedBy); using (CrystalReportViewer frmViewer = new CrystalReportViewer(rptReceipt)) { frmViewer.ShowDialog(); } } } //-----------------------