示例#1
0
 private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
 {
     if (e.Col < 2)           //raw benefit
     {
         FormEtrans270EBraw FormE = new FormEtrans270EBraw();
         FormE.EB271val = listEB[e.Row];
         FormE.ShowDialog();
         //user can't make changes, so no need to refresh grid.
     }
     else                                    //generated benefit
     {
         if (listEB[e.Row].Benefitt == null) //create new benefit
         {
             listEB[e.Row].Benefitt = new Benefit();
             FormBenefitEdit FormB = new FormBenefitEdit(0, PlanNum);
             FormB.IsNew  = true;
             FormB.BenCur = listEB[e.Row].Benefitt;
             FormB.ShowDialog();
             if (FormB.BenCur == null)                   //user deleted or cancelled
             {
                 listEB[e.Row].Benefitt = null;
             }
         }
         else                  //edit existing benefit
         {
             FormBenefitEdit FormB = new FormBenefitEdit(0, PlanNum);
             FormB.BenCur = listEB[e.Row].Benefitt;
             FormB.ShowDialog();
             if (FormB.BenCur == null)                   //user deleted
             {
                 listEB[e.Row].Benefitt = null;
             }
         }
         FillGrid();
     }
 }
		private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			if(e.Col==0) {//raw benefit
				FormEtrans270EBraw FormE=new FormEtrans270EBraw();
				FormE.EB271val=listEB[e.Row];
				FormE.ShowDialog();
				//user can't make changes, so no need to refresh grid.
			}
			else {//generated benefit
				if(listEB[e.Row].Benefitt==null) {//create new benefit
					listEB[e.Row].Benefitt=new Benefit();
					FormBenefitEdit FormB=new FormBenefitEdit(0,PlanNum);
					FormB.IsNew=true;
					FormB.BenCur=listEB[e.Row].Benefitt;
					FormB.ShowDialog();
					if(FormB.BenCur==null) {//user deleted or cancelled
						listEB[e.Row].Benefitt=null;
					}
				}
				else {//edit existing benefit
					FormBenefitEdit FormB=new FormBenefitEdit(0,PlanNum);
					FormB.BenCur=listEB[e.Row].Benefitt;
					FormB.ShowDialog();
					if(FormB.BenCur==null) {//user deleted
						listEB[e.Row].Benefitt=null;
					}
				}
				FillGrid();
			}
		}