private void FillGrid() { ListLabs = Laboratories.Refresh(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableLabs", "Description"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableLabs", "Phone"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableLabs", "Notes"), 200); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ListLabs.Count; i++) { row = new ODGridRow(); row.Cells.Add(ListLabs[i].Description); row.Cells.Add(ListLabs[i].Phone); row.Cells.Add(ListLabs[i].Notes); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FillGrid() { ListLabs = Laboratories.Refresh(); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g("TableLabs", "Description"), 100); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableLabs", "Phone"), 100); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableLabs", "Hidden"), 50, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableLabs", "Notes"), 200); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < ListLabs.Count; i++) { row = new GridRow(); row.Cells.Add(ListLabs[i].Description); row.Cells.Add(ListLabs[i].Phone); row.Cells.Add(ListLabs[i].IsHidden?"X":""); row.Cells.Add(ListLabs[i].Notes); gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
private void FormLabCaseEdit_Load(object sender, System.EventArgs e) { if (Plugins.HookMethod(this, "FormLabCaseEdit.Load_start", CaseCur, IsNew)) { return; } textPatient.Text = Patients.GetPat(CaseCur.PatNum).GetNameFL(); ListLabs = Laboratories.Refresh(); for (int i = 0; i < ListLabs.Count; i++) { listLab.Items.Add(ListLabs[i].Description + " " + ListLabs[i].Phone); if (ListLabs[i].LaboratoryNum == CaseCur.LaboratoryNum) { listLab.SelectedIndex = i; } } _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { comboProv.Items.Add(_listProviders[i].Abbr); if (_listProviders[i].ProvNum == CaseCur.ProvNum) { comboProv.SelectedIndex = i; } } Appointment apt = Appointments.GetOneApt(CaseCur.AptNum); if (apt != null) { if (apt.AptStatus == ApptStatus.UnschedList) { textAppointment.Text = Lan.g(this, "Unscheduled"); } else { textAppointment.Text = apt.AptDateTime.ToShortDateString() + " " + apt.AptDateTime.ToShortTimeString(); } textAppointment.Text += ", " + apt.ProcDescript; } apt = Appointments.GetOneApt(CaseCur.PlannedAptNum); if (apt != null) { textPlanned.Text = apt.ProcDescript; if (textPlanned.Text == "") { textPlanned.Text = Lan.g(this, "Attached"); } } if (CaseCur.DateTimeCreated.Year > 1880) { textDateCreated.Text = CaseCur.DateTimeCreated.ToString(); } if (CaseCur.DateTimeSent.Year > 1880) { textDateSent.Text = CaseCur.DateTimeSent.ToString(); } if (CaseCur.DateTimeRecd.Year > 1880) { textDateRecd.Text = CaseCur.DateTimeRecd.ToString(); } if (CaseCur.DateTimeChecked.Year > 1880) { textDateChecked.Text = CaseCur.DateTimeChecked.ToString(); } if (CaseCur.DateTimeDue.Year > 1880) { textDateDue.Text = CaseCur.DateTimeDue.ToShortDateString() + " " + CaseCur.DateTimeDue.ToShortTimeString(); } textInstructions.Text = CaseCur.Instructions; textLabFee.Text = CaseCur.LabFee.ToString("n"); sheet = Sheets.GetLabSlip(CaseCur.PatNum, CaseCur.LabCaseNum); if (sheet == null) { butSlip.Text = Lan.g(this, "New Slip"); } else { butSlip.Text = Lan.g(this, "Edit Slip"); } Plugins.HookAddCode(this, "FormLabCaseEdit.Load_end", CaseCur, IsNew); }
private void FormLabCaseEdit_Load(object sender, System.EventArgs e) { textPatient.Text = Patients.GetPat(CaseCur.PatNum).GetNameFL(); ListLabs = Laboratories.Refresh(); for (int i = 0; i < ListLabs.Count; i++) { listLab.Items.Add(ListLabs[i].Description + " " + ListLabs[i].Phone); if (ListLabs[i].LaboratoryNum == CaseCur.LaboratoryNum) { listLab.SelectedIndex = i; } } for (int i = 0; i < Providers.List.Length; i++) { comboProv.Items.Add(Providers.List[i].Abbr); if (Providers.List[i].ProvNum == CaseCur.ProvNum) { comboProv.SelectedIndex = i; } } Appointment apt = Appointments.GetOneApt(CaseCur.AptNum); if (apt != null) { if (apt.AptStatus == ApptStatus.UnschedList) { textAppointment.Text = Lan.g(this, "Unscheduled"); } else { textAppointment.Text = apt.AptDateTime.ToShortDateString() + " " + apt.AptDateTime.ToShortTimeString(); } textAppointment.Text += ", " + apt.ProcDescript; } apt = Appointments.GetOneApt(CaseCur.PlannedAptNum); if (apt != null) { textPlanned.Text = apt.ProcDescript; if (textPlanned.Text == "") { textPlanned.Text = Lan.g(this, "Attached"); } } if (CaseCur.DateTimeCreated.Year > 1880) { textDateCreated.Text = CaseCur.DateTimeCreated.ToString(); } if (CaseCur.DateTimeSent.Year > 1880) { textDateSent.Text = CaseCur.DateTimeSent.ToString(); } if (CaseCur.DateTimeRecd.Year > 1880) { textDateRecd.Text = CaseCur.DateTimeRecd.ToString(); } if (CaseCur.DateTimeChecked.Year > 1880) { textDateChecked.Text = CaseCur.DateTimeChecked.ToString(); } if (CaseCur.DateTimeDue.Year > 1880) { textDateDue.Text = CaseCur.DateTimeDue.ToShortDateString() + " " + CaseCur.DateTimeDue.ToShortTimeString(); } textInstructions.Text = CaseCur.Instructions; }
private void FormLabCaseEdit_Load(object sender, System.EventArgs e) { if (Plugins.HookMethod(this, "FormLabCaseEdit.Load_start", CaseCur, IsNew)) { return; } if (CaseCur == null) { MsgBox.Show(this, "Lab case no longer exists."); DialogResult = DialogResult.Abort; //Results in form closing logic return; } Patient pat = Patients.GetPat(CaseCur.PatNum); //If pat is null, this can trickle down and allow the user to create a lab sheet with a FK to an invalid Patient. if (pat == null) { MsgBox.Show(this, "There is no valid Patient attached to this Labcase."); DialogResult = DialogResult.Abort; //Results in form closing logic return; } textPatient.Text = pat.GetNameFL(); ListLabs = Laboratories.Refresh(); //Include the current lab, even if it is hidden. ListLabs = ListLabs.Where(x => x.LaboratoryNum == CaseCur.LaboratoryNum || !x.IsHidden).ToList(); for (int i = 0; i < ListLabs.Count; i++) { listLab.Items.Add(ListLabs[i].Description + " " + ListLabs[i].Phone); if (ListLabs[i].LaboratoryNum == CaseCur.LaboratoryNum) { listLab.SelectedIndex = i; } } _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { comboProv.Items.Add(_listProviders[i].Abbr); if (_listProviders[i].ProvNum == CaseCur.ProvNum) { comboProv.SelectedIndex = i; } } Appointment apt = Appointments.GetOneApt(CaseCur.AptNum); if (apt != null) { if (apt.AptStatus == ApptStatus.UnschedList) { textAppointment.Text = Lan.g(this, "Unscheduled"); } else { textAppointment.Text = apt.AptDateTime.ToShortDateString() + " " + apt.AptDateTime.ToShortTimeString(); } textAppointment.Text += ", " + apt.ProcDescript; } apt = Appointments.GetOneApt(CaseCur.PlannedAptNum); if (apt != null) { textPlanned.Text = apt.ProcDescript; if (textPlanned.Text == "") { textPlanned.Text = Lan.g(this, "Attached"); } } if (CaseCur.DateTimeCreated.Year > 1880) { textDateCreated.Text = CaseCur.DateTimeCreated.ToString(); } if (CaseCur.DateTimeSent.Year > 1880) { textDateSent.Text = CaseCur.DateTimeSent.ToString(); } if (CaseCur.DateTimeRecd.Year > 1880) { textDateRecd.Text = CaseCur.DateTimeRecd.ToString(); } if (CaseCur.DateTimeChecked.Year > 1880) { textDateChecked.Text = CaseCur.DateTimeChecked.ToString(); } if (CaseCur.DateTimeDue.Year > 1880) { textDateDue.Text = CaseCur.DateTimeDue.ToShortDateString() + " " + CaseCur.DateTimeDue.ToShortTimeString(); } textInstructions.Text = CaseCur.Instructions; textLabFee.Text = CaseCur.LabFee.ToString("n"); sheet = Sheets.GetLabSlip(CaseCur.PatNum, CaseCur.LabCaseNum); if (sheet == null) { butSlip.Text = Lan.g(this, "New Slip"); } else { butSlip.Text = Lan.g(this, "Edit Slip"); } textInvoiceNumber.Text = CaseCur.InvoiceNum; Plugins.HookAddCode(this, "FormLabCaseEdit.Load_end", CaseCur, IsNew); }