private void butAdd_Click(object sender, System.EventArgs e) { Def DefCur = new Def(); DefCur.ItemOrder = DefsList.Length; DefCur.Category = (DefCat)SelectedCat; DefCur.ItemName = ""; DefCur.ItemValue = ""; //necessary if (lookupCat[listCategory.SelectedIndex] == DefCat.ImageCats) { FormDefEditImages FormDEI = new FormDefEditImages(DefCur); FormDEI.IsNew = true; FormDEI.ShowDialog(); if (FormDEI.DialogResult != DialogResult.OK) { return; } } else { FormDefEdit FormDE = new FormDefEdit(DefCur); FormDE.IsNew = true; FormDE.ShowDialog(); if (FormDE.DialogResult != DialogResult.OK) { return; } } DefsSelected = DefsList.Length; //this is one more than allowed, but it's ok DefsIsSelected = true; changed = true; FillDefs(); }
private void butAdd_Click(object sender, System.EventArgs e) { Def DefCur=new Def(); DefCur.ItemOrder=DefsList.Length; DefCur.Category=(DefCat)SelectedCat; DefCur.ItemName=""; DefCur.ItemValue="";//necessary if(lookupCat[listCategory.SelectedIndex]==DefCat.ImageCats) { FormDefEditImages FormDEI=new FormDefEditImages(DefCur); FormDEI.IsNew=true; FormDEI.ShowDialog(); if(FormDEI.DialogResult!=DialogResult.OK) { return; } } else { FormDefEdit FormDE=new FormDefEdit(DefCur); FormDE.IsNew=true; FormDE.ShowDialog(); if(FormDE.DialogResult!=DialogResult.OK) { return; } } DefsSelected=DefsList.Length;//this is one more than allowed, but it's ok DefsIsSelected=true; changed=true; FillDefs(); }
public static bool GridDefsDoubleClick(Def selectedDef, ODGrid gridDefs, DefCatOptions selectedDefCatOpt, List <Def> listDefsCur, List <Def> listDefsAll, bool isDefChanged) { switch (selectedDefCatOpt.DefCat) { case DefCat.BlockoutTypes: FormDefEditBlockout FormDEB = new FormDefEditBlockout(selectedDef); FormDEB.ShowDialog(); if (FormDEB.DialogResult == DialogResult.OK) { isDefChanged = true; } break; case DefCat.ImageCats: FormDefEditImages FormDEI = new FormDefEditImages(selectedDef); FormDEI.IsNew = false; FormDEI.ShowDialog(); if (FormDEI.DialogResult == DialogResult.OK) { isDefChanged = true; } break; case DefCat.WebSchedNewPatApptTypes: FormDefEditWSNPApptTypes FormDEWSNPAT = new FormDefEditWSNPApptTypes(selectedDef); if (FormDEWSNPAT.ShowDialog() == DialogResult.OK) { if (FormDEWSNPAT.IsDeleted) { listDefsAll.Remove(selectedDef); } isDefChanged = true; } break; default: //Show the normal FormDefEdit window. FormDefEdit FormDefEdit2 = new FormDefEdit(selectedDef, listDefsCur, selectedDefCatOpt); FormDefEdit2.IsNew = false; FormDefEdit2.ShowDialog(); if (FormDefEdit2.DialogResult == DialogResult.OK) { if (FormDefEdit2.IsDeleted) { listDefsAll.Remove(selectedDef); } isDefChanged = true; } break; } return(isDefChanged); }
private void tbDefs_CellDoubleClicked(object sender, CellEventArgs e) { tbDefs.BackGColor[0, e.Row] = SystemColors.Highlight; tbDefs.BackGColor[1, e.Row] = SystemColors.Highlight; tbDefs.Refresh(); DefsIsSelected = true; DefsSelected = e.Row; if (lookupCat[listCategory.SelectedIndex] == DefCat.ImageCats) { FormDefEditImages FormDEI = new FormDefEditImages(DefsList[e.Row]); FormDEI.IsNew = false; FormDEI.ShowDialog(); } else { FormDefEdit FormDefEdit2 = new FormDefEdit(DefsList[e.Row]); FormDefEdit2.IsNew = false; FormDefEdit2.ShowDialog(); //Preferences2.GetCatList(listCategory.SelectedIndex); } changed = true; FillDefs(); }
private void tbDefs_CellDoubleClicked(object sender, CellEventArgs e) { tbDefs.BackGColor[0,e.Row]=SystemColors.Highlight; tbDefs.BackGColor[1,e.Row]=SystemColors.Highlight; tbDefs.Refresh(); DefsIsSelected=true; DefsSelected=e.Row; if(lookupCat[listCategory.SelectedIndex]==DefCat.ImageCats) { FormDefEditImages FormDEI=new FormDefEditImages(DefsList[e.Row]); FormDEI.IsNew=false; FormDEI.ShowDialog(); } else { FormDefEdit FormDefEdit2 = new FormDefEdit(DefsList[e.Row]); FormDefEdit2.IsNew=false; FormDefEdit2.ShowDialog(); //Preferences2.GetCatList(listCategory.SelectedIndex); } changed=true; FillDefs(); }
public static bool AddDef(ODGrid gridDefs, DefCatOptions selectedDefCatOpt) { Def defCur = new Def(); defCur.IsNew = true; int itemOrder = 0; if (Defs.GetDefsForCategory(selectedDefCatOpt.DefCat).Count > 0) { itemOrder = Defs.GetDefsForCategory(selectedDefCatOpt.DefCat).Max(x => x.ItemOrder) + 1; } defCur.ItemOrder = itemOrder; defCur.Category = selectedDefCatOpt.DefCat; defCur.ItemName = ""; defCur.ItemValue = ""; //necessary if (selectedDefCatOpt.DefCat == DefCat.InsurancePaymentType) { defCur.ItemValue = "N"; } switch (selectedDefCatOpt.DefCat) { case DefCat.BlockoutTypes: FormDefEditBlockout FormDEB = new FormDefEditBlockout(defCur); FormDEB.IsNew = true; if (FormDEB.ShowDialog() != DialogResult.OK) { return(false); } break; case DefCat.ImageCats: FormDefEditImages FormDEI = new FormDefEditImages(defCur); FormDEI.IsNew = true; FormDEI.ShowDialog(); if (FormDEI.DialogResult != DialogResult.OK) { return(false); } break; case DefCat.WebSchedNewPatApptTypes: FormDefEditWSNPApptTypes FormDEWSNPAT = new FormDefEditWSNPApptTypes(defCur); if (FormDEWSNPAT.ShowDialog() != DialogResult.OK) { return(false); } break; default: List <Def> listCurrentDefs = new List <Def>(); foreach (ODGridRow rowCur in gridDefs.Rows) { listCurrentDefs.Add((Def)rowCur.Tag); } FormDefEdit FormDE = new FormDefEdit(defCur, listCurrentDefs, selectedDefCatOpt); FormDE.IsNew = true; FormDE.ShowDialog(); if (FormDE.DialogResult != DialogResult.OK) { return(false); } break; } return(true); }