Exemplo 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();
                 }
             }
         }
     }
 }
Exemplo n.º 2
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;
         }
     }
 }
Exemplo n.º 3
0
        private void CheckMoney()
        {
            if (rg01.SelectedIndex == 0)
            {
                GV_Body.ActiveFilterEnabled = false;
                GV_Body.ActiveFilterString  = "[XG007] = 'N'";
                GV_Body.ActiveFilterEnabled = true;
            }
            else if (rg01.SelectedIndex == 1)
            {
                GV_Body.ActiveFilterEnabled = false;
                GV_Body.ActiveFilterString  = "[XG008] > 0";
                GV_Body.ActiveFilterEnabled = true;
            }
            else if (rg01.SelectedIndex == 2)
            {
                GV_Body.ActiveFilterEnabled = false;
                GV_Body.ActiveFilterString  = "";
                GV_Body.ActiveFilterEnabled = true;
            }
            float mSale  = 0;
            float mSale2 = 0;
            float mSale3 = 0;

            for (int i = 0; i < GV_Body.RowCount; i++)
            {
                if (GV_Body.GetRowCellValue(i, "XG004") != null)
                {
                    mSale += float.Parse(GV_Body.GetRowCellValue(i, "XG004").ToString());
                    if (GV_Body.GetRowCellValue(i, "XG007").ToString() == "Y")
                    {
                        mSale2 += float.Parse(GV_Body.GetRowCellValue(i, "XG004").ToString());
                    }
                    else if (GV_Body.GetRowCellValue(i, "XG007").ToString() == "N")
                    {
                        mSale3 += float.Parse(GV_Body.GetRowCellValue(i, "XG004").ToString());
                    }
                }
            }
            edMoney1.Text = mSale.ToString();
            edMoney2.Text = mSale2.ToString();
            //edMoney3.Text = (mSale - mSale2).ToString();
            edMoney3.Text = mSale3.ToString();
        }
Exemplo n.º 4
0
 private void XG002ButtonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
 {
     if (GetGridStatu() != BaseForm.GridStatu.gsBrowse)
     {
         string mXB007 = GV_Body.GetRowCellValue(FocuseRow_Body, "XB007").ToString();
         f2.SetMI      = new string[] { "POSXG", "002" };
         f2.SetMIParam = new string[] { XF002.Text, mXB007 };
         if (f2.GetMI)
         {
             GV_Body.SetRowCellValue(FocuseRow_Body, "XG002", f2.GetReturn[0]);
             GV_Body.SetRowCellValue(FocuseRow_Body, "XG002C", f2.GetReturn[1]);
             GV_Body.SetRowCellValue(FocuseRow_Body, "XB004", f2.GetReturn[2]);
             float mPrice = float.Parse(f2.GetReturn[2]);
             float mQty   = float.Parse(GV_Body.GetRowCellValue(FocuseRow_Body, "XG003").ToString());
             GV_Body.SetRowCellValue(FocuseRow_Body, "XG004", mPrice * mQty);
             GV_Body.FocusedColumn = GV_Body.VisibleColumns[9];//數量
             GV_Body.ShowEditor();
         }
     }
 }