Esempio n. 1
0
 private void XO004ButtonEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (GetGridStatu() != BaseForm.GridStatu.gsBrowse)
     {
         string mType = GV_Body.GetFocusedRowCellValue("XO004").ToString();
         f2.SetMI      = new string[] { "POSXH", "001" };
         f2.SetMIParam = new string[] { mType };
         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_Body.RowCount; i++)
                 {
                     if ((GV_Body.GetRowCellValue(i, "XO005") == null))
                     {
                         IsExist = false;
                         break;
                     }
                     if (GV_Body.GetRowCellValue(i, "XO005").ToString() == s.Value[0])
                     {
                         if (GV_Body.GetRowCellValue(i, "XO004").ToString() == mType)
                         {
                             IsExist = true;
                             break;
                         }
                     }
                 }
                 if (IsExist)
                 {
                     IsExist = false;
                     continue;
                 }
                 else
                 {
                     if (IsFirst)
                     {
                         IsFirst = false;
                     }
                     else
                     {
                         GV_Body.AddNewRow();
                     }
                     GV_Body.SetFocusedRowCellValue("XO001", XN001.Text);
                     GV_Body.SetFocusedRowCellValue("XO002", XN002.EditValue);
                     GV_Body.SetFocusedRowCellValue("XO003", XN003.Text);
                     GV_Body.SetFocusedRowCellValue("XO004", mType);
                     GV_Body.SetFocusedRowCellValue("XO005", s.Value[0]);
                     GV_Body.SetFocusedRowCellValue("XO005C", s.Value[1]);
                     GV_Body.UpdateCurrentRow();
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public override void GC_Body_MouseClick(object sender, MouseEventArgs e)
 {
     base.GC_Body_MouseClick(sender, e);
     if (IsCheckRequired)
     {
         if (GV_Body.RowCount == 0)
         {
             GV_Body.AddNewRow();
         }
     }
 }
Esempio n. 3
0
 public override void GV_Body_KeyDown(object sender, KeyEventArgs e)
 {
     base.GV_Body_KeyDown(sender, e);
     GV_Body.PostEditor();
     if (e.KeyData == Keys.Down && IsKeyDownOK)
     {
         ColumnView view = (ColumnView)GC_Body.FocusedView;
         if (view.IsLastRow)
         {
             GV_Body.AddNewRow();
         }
     }
 }
Esempio n. 4
0
 private void GetSPValue(List <List <string> > ls)
 {
     if (XF008.Text != "" && XF002.Text != "")
     {
         if (ls != null)
         {
             for (int j = 0; j < ls.Count; j++)
             {
                 for (int i = 0; i < GV_Body.RowCount; i++)
                 {
                     if (GV_Body.GetRowCellValue(i, "XB007") != null && GV_Body.GetRowCellValue(i, "XG002") != null)
                     {
                         if (ls[j][1] == GV_Body.GetRowCellValue(i, "XB007").ToString() &&
                             ls[j][3] == GV_Body.GetRowCellValue(i, "XG002").ToString())
                         {
                             ls[j][0] = "F";
                         }
                     }
                 }
             }
             for (int j = 0; j < ls.Count; j++)
             {
                 if (ls[j][0] == "T")
                 {
                     if (GV_Body.GetFocusedRowCellValue("XG002") == null)
                     {
                         GV_Body.AddNewRow();
                     }
                     else
                     {
                         if (GV_Body.GetFocusedRowCellValue("XG002").ToString().Trim() != "")
                         {
                             GV_Body.AddNewRow();
                         }
                     }
                     GV_Body.SetFocusedRowCellValue("XG001", XF001.Text);
                     GV_Body.SetFocusedRowCellValue("XB007", ls[j][1]);
                     GV_Body.SetFocusedRowCellValue("XB007C", ls[j][2]);
                     GV_Body.SetFocusedRowCellValue("XG002", ls[j][3]);
                     GV_Body.SetFocusedRowCellValue("XG002C", ls[j][4]);
                     GV_Body.SetFocusedRowCellValue("XG006", fc.FUser.ID);
                     GV_Body.SetFocusedRowCellValue("XG006C", fc.FUser.Name);
                     GV_Body.SetFocusedRowCellValue("XB004", ls[j][5]);
                     GV_Body.SetFocusedRowCellValue("XG004", ls[j][5]);
                 }
             }
             GV_Body.PostEditor();
             GV_Body.FocusedRowHandle = GV_Body.RowCount;
         }
     }
 }