public FilteredNotes(Database aDatabase) { // // Required for Windows Form Designer support // InitializeComponent(); database = aDatabase; SetupDataGridNotesFiltered(); }
public AddDiagnosisNumber(Database aDatabase) { // // Required for Windows Form Designer support // InitializeComponent(); database = aDatabase; btnAdd.Enabled = false; }
public Statistics(Database aDatabase) { // // Required for Windows Form Designer support // InitializeComponent(); database = aDatabase; //Setup statisticstab dgDiagnosis.SetDataBinding(database.DsMaster, "Diagnosis"); SetupStatisticsControls(); SetupDataGridDiagnosis(); }
public Primula(Database aDatabase) { // // Required for Windows Form Designer support // InitializeComponent(); year = System.DateTime.Now.Year; database = aDatabase; dgToPrimula.SetDataBinding(database.DsMaster, "Joined"); dgInPrimula.SetDataBinding(database.DsMaster, "Joined"); SetupDataGridPrimula(dgToPrimula); SetupDataGridPrimula(dgInPrimula); dgToPrimula.CaptionText = "Besök som ska registreras i Primula"; dgInPrimula.CaptionText = "Besök registrerade i Primula"; cmToPrimula = (CurrencyManager)BindingContext[dgToPrimula.DataSource,dgToPrimula.DataMember]; cmInPrimula = (CurrencyManager)BindingContext[dgInPrimula.DataSource,dgInPrimula.DataMember]; dvToPrimula = (System.Data.DataView) cmToPrimula.List; dvInPrimula = (System.Data.DataView) cmInPrimula.List; //Select the current month as default dvToPrimula.RowFilter = "primula = false AND visitnote = true AND SUBSTRING(visitdatetime,1,4)=" + year.ToString() + " AND SUBSTRING(visitdatetime,6,2)=" + System.DateTime.Now.Month; dvToPrimula.Sort = "visitdatetime DESC"; //Select the current month as default dvInPrimula.RowFilter = "primula = true AND visitnote = true AND SUBSTRING(visitdatetime,1,4)=" + year.ToString() + " AND SUBSTRING(visitdatetime,6,2)=" + System.DateTime.Now.Month; dvInPrimula.Sort = "visitdatetime DESC"; monthsInPrimula = new ArrayList(); monthsToPrimula = new ArrayList(); selectedRows = new ArrayList(); selectedNotes = new ArrayList(); SetupComboBoxPickMonthInPrimula(); SetupComboBoxPickMonthToPrimula(); SetupPrinting(); note = new Note(); this.ttPrimulaRemove.SetToolTip(this.btnPrimulaRemove, "Ta bort ett eller flera besök från listan med besök som ska registreras i Primula.\nT.ex. om besöken av någon anledning inte ska skickas in till Landstinget.\nObeservera att dessa besök hamnar under den andra fliken"); this.ttWritePrimula.SetToolTip(this.btnWritePrimula, "Skriver en Primula-fil som ska skickas in till Landstinget."); this.ttPrimulaAdd.SetToolTip(this.btnPrimulaAdd, "Lägg till ett besök till listan med besök som ska registreras i Primula.\nT.ex. om besöket ska registreras om."); CalculateVisits(); }
public Form2(Database aDatabase, ref Patient aPatient) { // // Required for Windows Form Designer support // InitializeComponent(); patient = aPatient; database = aDatabase; //Investige if the patient is a new patient or a already existing one regExpDate = new System.Text.RegularExpressions.Regex(@"(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])"); UpdateForm(); }
public Form3(Database aDatabase, ref Note aNote, ref Patient aPatient) { InitializeComponent(); database = aDatabase; note = aNote; patient = aPatient; dgDiagnosis.SetDataBinding(database.DsMaster, "Diagnosis"); SetupPatientChargeComboBox(); SetupVisitTypeComboBox(); SetupTreeView(); SetupDataGridDiagnosis(); }
public PreviousNotes(Database aDatabase, Patient aPatient) { // // Required for Windows Form Designer support // InitializeComponent(); database = aDatabase; CurrencyManager cm = (CurrencyManager) this.BindingContext[database.DsMaster, "Patients"]; System.Data.DataView dv = (System.Data.DataView) cm.List; dv.Sort = "patientid"; int position = dv.Find(aPatient.Id); this.BindingContext[database.DsMaster, "Patients"].Position = position; dgNotes.SetDataBinding(database.DsMaster, "Patients.PatientNotes"); SetupDataGridNotes(); }
public PrintReceiptDlg(Database aDatabase, System.Data.DataSet aDsPatientNotes, Patient aPatient) { // // Required for Windows Form Designer support // InitializeComponent(); database = aDatabase; dsPatientNotes = aDsPatientNotes; patient = aPatient; months = new ArrayList(); year = System.DateTime.Now.Year; SetupPrinting(Settings.ReceiptLogoFilename); selectedRows = new ArrayList(); lblPatient.Text = lblPatient.Text + " " + patient.Surname + " " + patient.Firstname + ", " + patient.Personnumber; dgReceipt.SetDataBinding(database.DsMaster, "Joined"); SetupDataGridReceipt(); SetupComboBoxPickYear(); cmbPickMonth.SelectedIndexChanged +=new EventHandler(cmbPickMonth_SelectedIndexChanged); SetupComboBoxPickMonth(); /*System.Windows.Forms.CurrencyManager cm = (CurrencyManager)BindingContext[dgReceipt.DataSource,dgReceipt.DataMember]; System.Data.DataView dv = (System.Data.DataView) cm.List; int selectedMonth = System.DateTime.Now.Month; dv.RowFilter = "patientid=" + patient.Id + " AND SUBSTRING(visitdatetime,1,4)=" + year.ToString() + " AND SUBSTRING(visitdatetime,6,2)=" + selectedMonth; dv.Sort = "visitdatetime DESC"; dgReceipt.CaptionText = "Besök under " + System.DateTime.Now.ToString("MMMM"); */ }
public static Utils.PatientNote[] CreatePatientNotesArray(Database database, System.Data.DataView dv) { ArrayList patientNotes = new ArrayList(); foreach (System.Data.DataRowView drv in dv) { Note tmpNote = database.CreateNote(drv.Row); Charge tmpCharge = database.CreateCharge(drv.Row); Patient tmpPatient = database.CreatePatient(drv.Row, null); Utils.PatientNote patientNote = new Utils.PatientNote(tmpPatient, tmpNote, tmpCharge); patientNotes.Add(patientNote); } Utils.PatientNote[] patientNotesArray; patientNotesArray = (Utils.PatientNote[]) patientNotes.ToArray((new Utils.PatientNote()).GetType()); return patientNotesArray; }
private void Form1_Load(object sender, System.EventArgs e) { try { Settings.LoadSettings(settingsFilename); } catch (Exception exception) { MessageBox.Show(exception.Message, "Felmeddelande",MessageBoxButtons.OK); this.Close(); return; } Form4 dlgWelcome = new Form4(); if (dlgWelcome.ShowDialog() == DialogResult.OK) { try { database = new Database(databaseFilename, dlgWelcome.Password); } catch (Exception exception) { MessageBox.Show(exception.Message, "Felmeddelande",MessageBoxButtons.OK); this.Close(); return; } SetupDataGridPatients(); System.Windows.Forms.CurrencyManager cm = (CurrencyManager)BindingContext[dgPatients.DataSource,dgPatients.DataMember]; System.Data.DataView dv = (System.Data.DataView) cm.List; if (dv.Count > 0) { dgPatients.Select(0); dgPatients.CurrentRowIndex = 0; UpdatePatient(dgPatients); } SetupDataGridNotes(); SetupDataGridJoined(); SetupComboBoxShowFiltered(); Utils.AutoSizeDataGrid(new string[]{"note"},dgNotes, this.BindingContext, 0); Utils.AutoSizeDataGrid(null, dgPatients, this.BindingContext, 0); SetupPrinting(Settings.ReceiptLogoFilename); } else this.Close(); }