Example #1
0
        private void butAddSpan_Click(object sender, System.EventArgs e)
        {
            if (gridMain.SelectedIndices.Length < 1)
            {
                MsgBox.Show(this, "Please select a category first.");
                return;
            }
            if (gridMain.Rows[gridMain.SelectedIndices[0]].Tag.GetType() != typeof(CovCat))
            {
                MsgBox.Show(this, "Please select a category first.");
                return;
            }
            CovSpan covspan = new CovSpan();

            covspan.CovCatNum = ((CovCat)gridMain.Rows[gridMain.SelectedIndices[0]].Tag).CovCatNum;
            FormInsSpanEdit FormE = new FormInsSpanEdit(covspan);

            FormE.IsNew = true;
            FormE.ShowDialog();
            if (FormE.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            FillSpans();
        }
Example #2
0
        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);
                }
            }
        }
Example #3
0
 private void butAddSpan_Click(object sender, System.EventArgs e)
 {
     if(gridMain.SelectedIndices.Length<1){
         MsgBox.Show(this,"Please select a category first.");
         return;
     }
     if(gridMain.Rows[gridMain.SelectedIndices[0]].Tag.GetType()!=typeof(CovCat)){
         MsgBox.Show(this,"Please select a category first.");
         return;
     }
     CovSpan covspan=new CovSpan();
     covspan.CovCatNum=((CovCat)gridMain.Rows[gridMain.SelectedIndices[0]].Tag).CovCatNum;
     FormInsSpanEdit FormE=new FormInsSpanEdit(covspan);
     FormE.IsNew=true;
     FormE.ShowDialog();
     if(FormE.DialogResult!=DialogResult.OK){
         return;
     }
     changed=true;
     FillSpans();
 }
Example #4
0
 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);
         }
     }
 }