Пример #1
0
        /// <summary>
        /// 画面クリア(0:全項目、1:KEY部以外)
        /// </summary>
        /// <param name="Kbn"></param>
        private void Scr_Clr(short Kbn)
        {
            foreach (Control ctl in detailControls)
            {
                if (ctl.GetType().Equals(typeof(CKM_Controls.CKM_CheckBox)))
                {
                    ((CheckBox)ctl).Checked = false;
                }
                else if (ctl.GetType().Equals(typeof(Panel)))
                {
                }
                else if (ctl.GetType().Equals(typeof(CKM_Controls.CKM_ComboBox)))
                {
                    ((CKM_Controls.CKM_ComboBox)ctl).SelectedIndex = -1;
                }
                else
                {
                    ctl.Text = "";
                }
            }

            foreach (Control ctl in detailLabels)
            {
                ((CKM_SearchControl)ctl).LabelText = "";
            }


            //初期値セット
            string ymd = mibl.GetDate();

            //スタッフマスター(M_Staff)に存在すること
            //[M_Staff]
            M_Staff_Entity mse = new M_Staff_Entity
            {
                StaffCD    = InOperatorCD,
                ChangeDate = ymd
            };
            Staff_BL bl  = new Staff_BL();
            bool     ret = bl.M_Staff_Select(mse);

            if (ret)
            {
                CboStoreCD.SelectedValue = mse.StoreCD;
            }

            //[M_Store]
            M_Store_Entity mse2 = new M_Store_Entity
            {
                StoreCD    = mse.StoreCD,
                ChangeDate = ymd
            };
            Store_BL  sbl = new Store_BL();
            DataTable dt  = sbl.M_Store_Select(mse2);

            if (dt.Rows.Count > 0)
            {
            }
            else
            {
                bbl.ShowMessage("E133");
                EndSec();
            }

            //出力対象
            RdoNotOutput.Checked = true;
            ScEDIOrderNO.Enabled = false;

            //発注日
            ckM_TextBox1.Text = ymd;
            ckM_TextBox2.Text = ymd;


            detailControls[0].Focus();
        }
Пример #2
0
        private bool CheckDetail(int index)
        {
            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                detailControls[index].Text = ehbl.FormatDate(detailControls[index].Text);

                //日付として正しいこと(Be on the correct date)E103
                if (!ehbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    ehbl.ShowMessage("E103");
                    return(false);
                }
                //処理日(From) ≧ 処理日(To)である場合Error
                if (index == (int)EIndex.DayEnd)
                {
                    if (!string.IsNullOrWhiteSpace(detailControls[index - 1].Text) && !string.IsNullOrWhiteSpace(detailControls[index].Text))
                    {
                        int result = detailControls[index].Text.CompareTo(detailControls[index - 1].Text);
                        if (result < 0)
                        {
                            //E106
                            ehbl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.StoreCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ehbl.ShowMessage("E102");
                    CboStoreCD.Focus();
                    return(false);
                }
                else
                {
                    //店舗権限のチェック、引数で処理可能店舗の配列をセットしたい
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        ehbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }
                break;

            case (int)EIndex.VendorCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScVendor.LabelText = "";
                    return(true);
                }

                //仕入先マスター(M_Vendor)に存在すること
                //[M_Vendor]
                M_Vendor_Entity mve = new M_Vendor_Entity
                {
                    VendorCD   = detailControls[index].Text,
                    ChangeDate = ehbl.GetDate(),
                    VendorFlg  = "1"
                };
                Vendor_BL bl  = new Vendor_BL();
                bool      ret = bl.M_Vendor_SelectTop1(mve);
                if (ret)
                {
                    ScVendor.LabelText = mve.VendorName;
                }
                else
                {
                    ehbl.ShowMessage("E101");
                    ScVendor.LabelText = "";
                    return(false);
                }
                break;
            }

            return(true);
        }