Ejemplo n.º 1
0
 private void gGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
 {
     if (e.Col == 3 || e.Col == 4)
     {
         SM_PORDERDTL dtl = gGrid1.GetCurSelect <SM_PORDERDTL>();
         dtl.PORTOTTAL = dtl.PURPRICE * dtl.PREPURQTY;
         SM_PORDER porder = this.editData as SM_PORDER;
         decimal   total  = 0;
         foreach (SM_PORDERDTL d in porder.PORDERDTL)
         {
             total += d.PORTOTTAL;
         }
         porder.TOTALAMT = total;
         TXT_TOTALAMT.SetValue(total);
         this.gGrid1.Refresh();
     }
     if (e.Col == 5)
     {
         SM_PORDERDTL dtl = gGrid1.GetCurSelect <SM_PORDERDTL>();
         if (dtl.PREPURQTY == 0)
         {
             dtl.PORTOTTAL = 0;
         }
         else
         {
             dtl.PURPRICE = dtl.PORTOTTAL / dtl.PREPURQTY;
         }
         SM_PORDER porder = this.editData as SM_PORDER;
         decimal   total  = 0;
         foreach (SM_PORDERDTL d in porder.PORDERDTL)
         {
             total += d.PORTOTTAL;
         }
         porder.TOTALAMT = total;
         TXT_TOTALAMT.SetValue(total);
         this.gGrid1.Refresh();
     }
 }
Ejemplo n.º 2
0
 public override void AddRow()
 {
     SM_PORDERDTL porderdtl = gGrid1.AddRow <SM_PORDERDTL>();
 }