/*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(); } } }