private void FillGridScreenPat() { ListScreenPats = ScreenPats.GetForScreenGroup(ScreenGroupCur.ScreenGroupNum); ListPats = Patients.GetPatsForScreenGroup(ScreenGroupCur.ScreenGroupNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col; col = new ODGridColumn(Lan.g(this, "PatNum"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Name"), 300); gridMain.Columns.Add(col); //todo: birthdate col = new ODGridColumn(Lan.g(this, "Age"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Race"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Gender"), 80); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ListPats.Count; i++) { row = new ODGridRow(); row.Cells.Add(ListPats[i].PatNum.ToString()); row.Cells.Add(ListPats[i].GetNameLF()); row.Cells.Add(ListPats[i].Age.ToString()); row.Cells.Add(ListPats[i].Race.ToString()); row.Cells.Add(ListPats[i].Gender.ToString()); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
/*private void butPatSelect_Click(object sender,EventArgs e) { * FormPatientSelect FormPS=new FormPatientSelect(); * FormPS.ShowDialog(); * if(FormPS.DialogResult!=DialogResult.OK) { * return; * } * PatCur=Patients.GetPat(FormPS.SelectedPatNum); * ScreenPatCur.PatNum=PatCur.PatNum; * textPatient.Text=PatCur.GetNameLF(); * }*/ private void butOK_Click(object sender, EventArgs e) { if (IsNew) { ScreenPats.Insert(ScreenPatCur); } DialogResult = DialogResult.OK; }
private void butAdd_Click(object sender, System.EventArgs e) { if (PrefC.GetBool(PrefName.PublicHealthScreeningUsePat)) { /* * FormScreenPatEdit FormSPE=new FormScreenPatEdit(); * FormSPE.IsNew=true; * while(true) { * FormSPE.ScreenPatCur=new ScreenPat(); * FormSPE.ScreenPatCur.ScreenGroupNum=ScreenGroupCur.ScreenGroupNum; * FormSPE.ScreenPatCur.SheetNum=PrefC.GetLong(PrefName.PublicHealthScreeningSheet); * FormSPE.ScreenGroupCur=ScreenGroupCur; * FormSPE.ScreenGroupCur.Description=textDescription.Text; * FormSPE.ShowDialog(); * if(FormSPE.DialogResult!=DialogResult.OK) { * return; * } * FillGridScreenPat(); * } */ FormScreenPatEdit FormSPE = new FormScreenPatEdit(); while (true) { FormPatientSelect FormPS = new FormPatientSelect(); FormPS.ShowDialog(); if (FormPS.DialogResult != DialogResult.OK) { return; } ScreenPat screenPat = new ScreenPat(); screenPat.ScreenGroupNum = ScreenGroupCur.ScreenGroupNum; screenPat.SheetNum = PrefC.GetLong(PrefName.PublicHealthScreeningSheet); screenPat.PatNum = FormPS.SelectedPatNum; ScreenPats.Insert(screenPat); if (FormPS.DialogResult != DialogResult.OK) { return; } FillGridScreenPat(); } } else { FormScreenEdit FormSE = new FormScreenEdit(); FormSE.ScreenGroupCur = ScreenGroupCur; FormSE.IsNew = true; if (ScreenList.Length == 0) { FormSE.ScreenCur = new OpenDentBusiness.Screen(); FormSE.ScreenCur.ScreenGroupOrder = 1; } else { FormSE.ScreenCur = ScreenList[ScreenList.Length - 1]; //'remembers' the last entry FormSE.ScreenCur.ScreenGroupOrder = FormSE.ScreenCur.ScreenGroupOrder + 1; //increments for next } while (true) { FormSE.ShowDialog(); if (FormSE.DialogResult != DialogResult.OK) { return; } FormSE.ScreenCur.ScreenGroupOrder++; FillGrid(); } } }