Exemple #1
0
        public override void GV_Main_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            base.GV_Main_FocusedRowChanged(sender, e);
            if (GV_Main.GetFocusedRowCellValue("XR005") == null)
            {
                return;
            }
            float mGrade = 0;

            if (float.TryParse(GV_Main.GetFocusedRowCellValue("XR005").ToString(), out mGrade))
            {
                if (mGrade < 0)
                {
                    IsGood = false;
                    mGrade = mGrade * -1;
                }
                else
                {
                    IsGood = true;
                }
            }
            else
            {
                IsGood = true;
            }
            SetLightOn(mGrade.ToString());
        }
Exemple #2
0
        private void XR006ButtonEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            RESAI04L ai04l = new RESAI04L();

            ai04l.SetKey = new string[] { KeyValue[0], GV_Main.GetFocusedRowCellValue("XB002").ToString() };
            ai04l.ShowDialog();
        }
Exemple #3
0
        public virtual bool CheckRequiredField()
        {
            if (IsNowDeleteRow)
            {
                IsNowDeleteRow = false;
                return(true);
            }

            if (RequiredFieldMain != "")
            {
                string[] mTemp = RequiredFieldMain.Split(',');
                if (GV_Main != null)
                {
                    for (int i = 0; i < mTemp.Length; i++)
                    {
                        if (GV_Main.GetFocusedRowCellValue(mTemp[i]) != null)
                        {
                            if (GV_Main.GetFocusedRowCellValue(mTemp[i]).ToString() == "")
                            {
                                IsCheckRequired = false;
                                MessageBox.Show(GV_Main.Columns[mTemp[i]].GetTextCaption() + " 不可空白!", "錯誤");
                                return(false);
                            }
                        }
                    }
                }
            }
            return(true);
        }
Exemple #4
0
 protected override void BtnQuery_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     base.BtnQuery_ItemClick(sender, e);
     if (GV_Main.GetFocusedRowCellValue("XR005") != null)
     {
         SetLightOn(GV_Main.GetFocusedRowCellValue("XR005").ToString());
     }
 }
Exemple #5
0
 private void btnStar1_MouseLeave(object sender, EventArgs e)
 {
     if (GetGridStatu() != SingleForm.GridStatu.gsBrowse)
     {
         if (GV_Main.GetFocusedRowCellValue("XR005") == null)
         {
             return;
         }
         SetLightOn(GV_Main.GetFocusedRowCellValue("XR005").ToString());
     }
 }
Exemple #6
0
 private void btnStar1_MouseUp(object sender, MouseEventArgs e)
 {
     if (GetGridStatu() != SingleForm.GridStatu.gsBrowse)
     {
         if (GV_Main.GetFocusedRowCellValue("XR005") == null)
         {
             return;
         }
         string mName  = (sender as SimpleButton).Name;
         int    mGrade = Int32.Parse(mName.Substring(mName.Length - 1, 1));
         if (e.Button == MouseButtons.Right)
         {
             IsGood = false;
             mGrade = mGrade * -1;
         }
         else
         {
             IsGood = true;
         }
         GV_Main.SetFocusedRowCellValue("XR005", mGrade);
     }
 }
Exemple #7
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();
                 }
             }
         }
     }
 }