private void butAddCat_Click(object sender, System.EventArgs e) { CovCat covcat=new CovCat(); covcat.CovOrder=(byte)CovCatC.Listt.Count; covcat.DefaultPercent=-1; FormInsCatEdit FormE=new FormInsCatEdit(covcat); FormE.IsNew=true; FormE.ShowDialog(); if(FormE.DialogResult==DialogResult.OK){ changed=true; FillSpans(); } }
private void butAddCat_Click(object sender, System.EventArgs e) { CovCat covcat = new CovCat(); covcat.CovOrder = (byte)CovCatC.Listt.Count; covcat.DefaultPercent = -1; FormInsCatEdit FormE = new FormInsCatEdit(covcat); FormE.IsNew = true; FormE.ShowDialog(); if (FormE.DialogResult == DialogResult.OK) { changed = true; FillSpans(); } }
private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { bool isCat = false; long selectedKey = 0; if (gridMain.Rows[e.Row].Tag.GetType() == typeof(CovCat)) { isCat = true; selectedKey = ((CovCat)gridMain.Rows[e.Row].Tag).CovCatNum; FormInsCatEdit FormE = new FormInsCatEdit((CovCat)gridMain.Rows[e.Row].Tag); FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } } else //covSpan { selectedKey = ((CovSpan)gridMain.Rows[e.Row].Tag).CovSpanNum; FormInsSpanEdit FormE = new FormInsSpanEdit((CovSpan)gridMain.Rows[e.Row].Tag); FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } } changed = true; FillSpans(); for (int i = 0; i < gridMain.Rows.Count; i++) { if (isCat && gridMain.Rows[i].Tag.GetType() == typeof(CovCat) && selectedKey == ((CovCat)gridMain.Rows[i].Tag).CovCatNum) { gridMain.SetSelected(i, true); } if (!isCat && gridMain.Rows[i].Tag.GetType() == typeof(CovSpan) && selectedKey == ((CovSpan)gridMain.Rows[i].Tag).CovSpanNum) { gridMain.SetSelected(i, true); } } }
private void gridMain_CellDoubleClick(object sender,OpenDental.UI.ODGridClickEventArgs e) { bool isCat=false; long selectedKey=0; if(gridMain.Rows[e.Row].Tag.GetType()==typeof(CovCat)){ isCat=true; selectedKey=((CovCat)gridMain.Rows[e.Row].Tag).CovCatNum; FormInsCatEdit FormE=new FormInsCatEdit((CovCat)gridMain.Rows[e.Row].Tag); FormE.ShowDialog(); if(FormE.DialogResult!=DialogResult.OK) { return; } } else{//covSpan selectedKey=((CovSpan)gridMain.Rows[e.Row].Tag).CovSpanNum; FormInsSpanEdit FormE=new FormInsSpanEdit((CovSpan)gridMain.Rows[e.Row].Tag); FormE.ShowDialog(); if(FormE.DialogResult!=DialogResult.OK){ return; } } changed=true; FillSpans(); for(int i=0;i<gridMain.Rows.Count;i++){ if(isCat && gridMain.Rows[i].Tag.GetType()==typeof(CovCat) && selectedKey==((CovCat)gridMain.Rows[i].Tag).CovCatNum) { gridMain.SetSelected(i,true); } if(!isCat && gridMain.Rows[i].Tag.GetType()==typeof(CovSpan) && selectedKey==((CovSpan)gridMain.Rows[i].Tag).CovSpanNum) { gridMain.SetSelected(i,true); } } }