//##########################################CLASS PatientRegistrationList EVENTS################################################# //event is raised when the class is loaded private void ClassLoad(object sender, EventArgs e) { try { _regManager = new RegistrationLogic(_userInfo); _regManager.DeleteImageDirectory(Application.StartupPath); _patientInfo = _regManager.SelectByPatientSystemIdPatientInformation(_userInfo, _patientId, Application.StartupPath); this.lblSysId.Text = _patientInfo.PatientSystemId; this.lblName.Text = _patientInfo.LastName.ToUpper() + ", " + _patientInfo.FirstName + " " + _patientInfo.MiddleName; if (!String.IsNullOrEmpty(_patientInfo.ImagePath)) { this.pbxPatient.Image = Image.FromFile(_patientInfo.ImagePath); } this.optRegistration.Checked = true; } catch (Exception ex) { DentalLib.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Patient Registration List"); this.Close(); } } //-------------------------------
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); }
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); }
} //------------------------------------ //this procedure updates a patient information public void UpdatePatientInformation(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo) { using (SqlCommand sqlComm = new SqlCommand()) { sqlComm.Connection = userInfo.Connection; sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.CommandText = "dental.UpdatePatientInformation"; sqlComm.Parameters.Add("@sysid_patient", SqlDbType.VarChar).Value = patientInfo.PatientSystemId; sqlComm.Parameters.Add("@last_name", SqlDbType.VarChar).Value = patientInfo.LastName; sqlComm.Parameters.Add("@first_name", SqlDbType.VarChar).Value = patientInfo.FirstName; sqlComm.Parameters.Add("@middle_name", SqlDbType.VarChar).Value = patientInfo.MiddleName; sqlComm.Parameters.Add("@home_address", SqlDbType.VarChar).Value = patientInfo.HomeAddress; sqlComm.Parameters.Add("@phone_nos", SqlDbType.VarChar).Value = patientInfo.PhoneNos; sqlComm.Parameters.Add("@birthdate", SqlDbType.DateTime).Value = DateTime.Parse(patientInfo.BirthDate); sqlComm.Parameters.Add("@e_mail", SqlDbType.VarChar).Value = patientInfo.Email; sqlComm.Parameters.Add("@medical_history", SqlDbType.VarChar).Value = patientInfo.MedicalHistory; sqlComm.Parameters.Add("@emergency_info", SqlDbType.VarChar).Value = patientInfo.EmergencyInfo; if (patientInfo.ImageBytes != null && !String.IsNullOrEmpty(patientInfo.ImagePath) && !String.IsNullOrEmpty(patientInfo.ImageExtension)) { sqlComm.Parameters.Add("@pic", SqlDbType.VarBinary).Value = patientInfo.ImageBytes; sqlComm.Parameters.Add("@extension_name", SqlDbType.VarChar).Value = patientInfo.ImageExtension; } else { sqlComm.Parameters.Add("@pic", SqlDbType.VarBinary).Value = DBNull.Value; sqlComm.Parameters.Add("@extension_name", SqlDbType.VarChar).Value = DBNull.Value; } sqlComm.Parameters.Add("@edited_by", SqlDbType.VarChar).Value = userInfo.UserId; sqlComm.ExecuteNonQuery(); } } //------------------------------------
} //----------------------------- //this procedure update a patient information public void UpdatePatientInformation(CommonExchange.Patient patientInfo) { Int32 index = 0; if (_patientTable != null) { foreach (DataRow patientRow in _patientTable.Rows) { if (String.Equals(patientRow["sysid_patient"].ToString(), patientInfo.PatientSystemId)) { DataRow editRow = _patientTable.Rows[index]; editRow.BeginEdit(); editRow["sysid_patient"] = patientInfo.PatientSystemId; editRow["last_name"] = patientInfo.LastName; editRow["first_name"] = patientInfo.FirstName; editRow["middle_name"] = patientInfo.MiddleName; editRow["home_address"] = patientInfo.HomeAddress; editRow["phone_nos"] = patientInfo.PhoneNos; editRow["birthdate"] = patientInfo.BirthDate; editRow["e_mail"] = patientInfo.Email; editRow["medical_history"] = patientInfo.MedicalHistory; editRow["emergency_info"] = patientInfo.EmergencyInfo; editRow.EndEdit(); break; } index++; } } } //------------------------------
} //------------------------------------ //this procedure updates a patient information public void UpdatePatientInformation(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo) { using (DatabaseLib.DbLibPatientManager dbLib = new DatabaseLib.DbLibPatientManager()) { dbLib.UpdatePatientInformation(userInfo, patientInfo); } _patientInfo = patientInfo; } //----------------------------
public PaymentDetailsCreate(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); }
public PatientRegistration(CommonExchange.SysAccess userInfo, RegistrationLogic regManager, CommonExchange.Patient patientInfo) { this.InitializeComponent(); _userInfo = userInfo; _patientInfo = patientInfo; _regManager = regManager; this.Load += new EventHandler(ClassLoad); this.lnkChange.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkChangeLinkClicked); }
public PatientChargesUpdate(CommonExchange.SysAccess userInfo, CommonExchange.Patient patientInfo, CommonExchange.Registration regInfo, CommonExchange.RegistrationDetails detailsInfo, ChargesLogic chargesManager) : base(userInfo, patientInfo, regInfo, chargesManager) { this.InitializeComponent(); _detailsInfo = detailsInfo; _detailsInfoTemp = detailsInfo; this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnUpdate.Click += new EventHandler(btnUpdateClick); this.btnDelete.Click += new EventHandler(btnDeleteClick); this.btnClose.Click += new EventHandler(btnCloseClick); }
} //------------------------------ #endregion #region Programmer-Defined Function Procedures //this function returns a selected patient information by patient id public CommonExchange.Patient SelectByPatientSystemIdPatientInformation(CommonExchange.SysAccess userInfo, String patientId, String startUp) { CommonExchange.Patient patientInfo = new CommonExchange.Patient(); using (DatabaseLib.DbLibPatientManager dbLib = new DatabaseLib.DbLibPatientManager()) { patientInfo = dbLib.SelectByPatientSystemIdPatientInformation(userInfo, patientId); patientInfo.ImagePath = this.GetEmployeeImagePath(userInfo, patientId, startUp); patientInfo.ImageBytes = DentalLib.ProcStatic.GetImageByte(patientInfo.ImagePath); patientInfo.ImageExtension = this.GetImageExtensionName(patientInfo.ImagePath); patientInfo.Age = this.GetPatientAge(DateTime.Parse(patientInfo.BirthDate), DateTime.Parse(s_serverDateTime)); } return(patientInfo); } //-----------------------
} //---------------------------------- //##########################################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; } //-----------------------
//############################################CLASS ProcedureInformation 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 Information"); _hasErrors = true; this.Close(); } _patientManager.DeleteImageDirectory(Application.StartupPath); _patientInfo = new CommonExchange.Patient(); _patientInfo.BirthDate = _patientManager.ServerDateTime; _patientInfo.EmergencyInfo = this.txtContactPerson.Text; this.txtBirthdate.Text = DateTime.Parse(_patientManager.ServerDateTime).ToLongDateString(); }
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); }
} //-------------------------- //this function returns a selected patient information by patient id public CommonExchange.Patient SelectByPatientSystemIdPatientInformation(CommonExchange.SysAccess userInfo, String patientId) { CommonExchange.Patient patientInfo = new CommonExchange.Patient(); using (SqlCommand sqlComm = new SqlCommand()) { sqlComm.Connection = userInfo.Connection; sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.CommandText = "dental.SelectBySysIDPatientPatientInformation"; sqlComm.Parameters.Add("@sysid_patient", SqlDbType.VarChar).Value = patientId; sqlComm.Parameters.Add("@system_user_id", SqlDbType.VarChar).Value = userInfo.UserId; using (SqlDataReader sqlReader = sqlComm.ExecuteReader()) { if (sqlReader.HasRows) { while (sqlReader.Read()) { patientInfo.PatientSystemId = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "sysid_patient", ""); patientInfo.LastName = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "last_name", ""); patientInfo.FirstName = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "first_name", ""); patientInfo.MiddleName = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "middle_name", ""); patientInfo.HomeAddress = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "home_address", ""); patientInfo.PhoneNos = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "phone_nos", ""); patientInfo.BirthDate = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "birthdate", ""); patientInfo.Email = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "e_mail", ""); patientInfo.MedicalHistory = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "medical_history", ""); patientInfo.EmergencyInfo = DatabaseLib.ProcStatic.DataReaderConvert(sqlReader, "emergency_info", ""); break; } } sqlReader.Close(); } } return(patientInfo); } //--------------------------
//this procedure inserts a new patient information public void InsertPatientInformation(CommonExchange.Patient patientInfo) { if (_patientTable != null) { DataRow newRow = _patientTable.NewRow(); newRow["sysid_patient"] = patientInfo.PatientSystemId; newRow["last_name"] = patientInfo.LastName; newRow["first_name"] = patientInfo.FirstName; newRow["middle_name"] = patientInfo.MiddleName; newRow["home_address"] = patientInfo.HomeAddress; newRow["phone_nos"] = patientInfo.PhoneNos; newRow["birthdate"] = patientInfo.BirthDate; newRow["e_mail"] = patientInfo.Email; newRow["medical_history"] = patientInfo.MedicalHistory; newRow["emergency_info"] = patientInfo.EmergencyInfo; _patientTable.Rows.Add(newRow); _patientTable.AcceptChanges(); } } //-----------------------------
//#####################################CLASS ProcedureInformationUpdate EVENTS######################################## //event is raised when the class is loaded protected override 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 Information"); _hasErrors = true; this.Close(); } _patientManager.DeleteImageDirectory(Application.StartupPath); _patientInfo = _patientManager.SelectByPatientSystemIdPatientInformation(_userInfo, _patientSysId, Application.StartupPath); _patientInfoTemp = _patientInfo; if (!String.IsNullOrEmpty(_patientInfo.ImagePath)) { this.pbxPatient.Image = Image.FromFile(_patientInfo.ImagePath); } this.lblSysID.Text = _patientInfo.PatientSystemId; this.txtLastName.Text = _patientInfo.LastName; this.txtFirstName.Text = _patientInfo.FirstName; this.txtMiddleName.Text = _patientInfo.MiddleName; this.txtBirthdate.Text = DateTime.Parse(_patientInfo.BirthDate).ToLongDateString(); this.txtPhone.Text = _patientInfo.PhoneNos; this.txtEmail.Text = _patientInfo.Email; this.txtAddress.Text = _patientInfo.HomeAddress; this.txtMedicalHistory.Text = _patientInfo.MedicalHistory; this.txtContactPerson.Text = _patientInfo.EmergencyInfo; this.txtLastName.Focus(); } //----------------------------------
public PatientLogic(CommonExchange.SysAccess userInfo) : base(userInfo) { _patientInfo = new CommonExchange.Patient(); }
//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(); } } } //-----------------------
public PatientRegistrationUpdate(CommonExchange.SysAccess userInfo, RegistrationLogic regManager, CommonExchange.Patient patientInfo, String registrationSysId) : base(userInfo, regManager, patientInfo) { this.InitializeComponent(); _registrationSysId = registrationSysId; this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnUpdate.Click += new EventHandler(btnUpdateClick); this.btnClose.Click += new EventHandler(btnCloseClick); }
public PatientRegistrationCreate(CommonExchange.SysAccess userInfo, RegistrationLogic regManager, CommonExchange.Patient patientInfo) : base(userInfo, regManager, patientInfo) { this.InitializeComponent(); this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnRegister.Click += new EventHandler(btnRegisterClick); 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(); } }