示例#1
0
 private void XK006ButtonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
 {
     //if (GetGridStatu() != BaseForm.GridStatu.gsBrowse)
     {
         int    mRowHandle = GV_Main.FocusedRowHandle;
         string mType      = GV_Main.GetFocusedRowCellValue("XK005").ToString();
         f2.SetMI = new string[] { "POSXH", "002" };
         //f2.SetMIParam = new string[] { GV_Main.GetFocusedRowCellValue("XK005").ToString(), FData[3], FData[4], FData[3], FData[4] };
         //f2.SetMIParam = new string[] { FData[3], FData[4], FData[5], FData[4], FData[5] };
         f2.SetMIParam = new string[] { mType, FData[3], FData[4], FData[5] };
         f2.SetMuity   = true;
         Dictionary <int, List <string> > muity = null;
         if (f2.GetMI)
         {
             muity = f2.GetMuity;
             bool IsExist = false;
             bool IsFirst = true;
             foreach (KeyValuePair <int, List <string> > s in muity)
             {
                 for (int i = 0; i < GV_Main.RowCount; i++)
                 {
                     int idx = GV_Main.GetRowHandle(i);
                     if ((GV_Main.GetRowCellValue(idx, "XK006") == null))
                     {
                         IsExist = false;
                         break;
                     }
                     if (GV_Main.GetRowCellValue(idx, "XK006").ToString() == s.Value[0])
                     {
                         if (GV_Main.GetRowCellValue(idx, "XK005").ToString() == mType)
                         {
                             if (idx == mRowHandle)
                             {
                                 IsFirst = false;
                             }
                             IsExist = true;
                             break;
                         }
                     }
                 }
                 if (IsExist)
                 {
                     IsExist = false;
                     continue;
                 }
                 else
                 {
                     if (IsFirst)
                     {
                         IsFirst = false;
                     }
                     else
                     {
                         GV_Main.AddNewRow();
                     }
                     int mIndex = GV_Main.RowCount;
                     GV_Main.SetFocusedRowCellValue("XK001", FData[0]);
                     GV_Main.SetFocusedRowCellValue("XK002", FData[1]);
                     GV_Main.SetFocusedRowCellValue("XK003", FData[2]);
                     GV_Main.SetFocusedRowCellValue("XK004", string.Format("{0:0000}", mIndex));
                     GV_Main.SetFocusedRowCellValue("XK005", mType);
                     GV_Main.SetFocusedRowCellValue("XK006", s.Value[0]);
                     GV_Main.SetFocusedRowCellValue("XK006C", s.Value[1]);
                     GV_Main.SetFocusedRowCellValue("XH004", s.Value[2]);
                     GV_Main.UpdateCurrentRow();
                 }
             }
         }
     }
 }