Ejemplo n.º 1
0
        private void Search_Mitsumori_Load(object sender, EventArgs e)
        {
            try
            {
                Scr_Clr();

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = OperatorCD,    //パラメータでオペレータCDをセット
                    ChangeDate = ssbl.GetDate()
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    CboStoreCD.SelectedValue = mse.StoreCD;
                    //ScStaff.LabelText = mse.StaffName;
                }
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                //EndSec();
            }
        }
Ejemplo n.º 2
0
        protected override void ExecDisp()
        {
            for (int i = 0; i < detailControls.Length; i++)
            {
                if (CheckDetail(i) == false)
                {
                    detailControls[i].Focus();
                    return;
                }
            }

            mbl = new Staff_BL();
            bool ret = BindGrid();

            if (ret)
            {
                dgvDetail.SelectionMode       = DataGridViewSelectionMode.RowHeaderSelect;
                dgvDetail.CurrentRow.Selected = true;
                dgvDetail.Enabled             = true;
                dgvDetail.Focus();
            }
            else
            {
                mbl.ShowMessage("E128");
            }
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                Scr_Clr();

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = OperatorCD, //パラメータでオペレータCDをセット
                    ChangeDate = tjbl.GetDate()
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    CboStoreCD.SelectedValue = mse.StoreCD;
                }
                CboStoreCD.SelectedValue = storeCD;

                detailControls[(int)EIndex.DayEnd].Text = tjbl.GetDate();
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                //EndSec();
            }
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                Scr_Clr();

                string ymd = snbl.GetDate();
                snbl = new ShukkaShijiTouroku_BL();
                CboSouko.Bind(ymd);
                CboCarrier.Bind(ymd);

                ScJuchuuNO.Value1 = OperatorCD;
                ScJuchuuNO.Value2 = AllAvailableStores;

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = OperatorCD,
                    ChangeDate = snbl.GetDate()
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    //[M_Souko_Search]
                    M_Souko_Entity me = new M_Souko_Entity
                    {
                        StoreCD    = mse.StoreCD,
                        SoukoType  = "3",
                        ChangeDate = ymd,
                        DeleteFlg  = "0"
                    };

                    DataTable mdt = snbl.M_Souko_Search(me);
                    if (mdt.Rows.Count > 0)
                    {
                        CboSouko.SelectedValue = mdt.Rows[0]["SoukoCD"];
                    }
                }

                for (int i = (int)EIndex.DayStart; i <= (int)EIndex.PlanDateEnd; i++)
                {
                    detailControls[i].Text = ymd;
                }
                detailControls[(int)EIndex.StaffCD].Text = OperatorCD;
                ScStaff.LabelText = mse.StaffName;

                detailControls[0].Focus();
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                //EndSec();
            }
        }
Ejemplo n.º 5
0
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                base.InProgramID = ProID;
                base.InProgramNM = ProNm;

                this.SetFunctionLabel(EProMode.BATCH);
                this.InitialControlArray();
                base.Btn_F12.Text = "データ出力(F12)";

                //起動時共通処理
                base.StartProgram();

                //コンボボックス初期化
                string ymd = bbl.GetDate();
                CboStoreCD.Bind(ymd);

                mibl = new EDIHacchuu_BL();

                //検索用のパラメータ設定
                string stores = GetAllAvailableStores();
                ScOrderNO.Value1    = InOperatorCD;
                ScOrderNO.Value2    = stores;
                ScEDIOrderNO.Value1 = InOperatorCD;
                ScEDIOrderNO.Value2 = stores;
                ScVendor.Value1     = "1";

                //スタッフマスター(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;
                }

                SetFuncKeyAll(this, "100001000001");
                Scr_Clr(0);
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                EndSec();
            }
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                InProgramID = ProID;
                InProgramNM = ProNm;

                this.SetFunctionLabel(EProMode.SHOW);   //照会プログラムとして起動
                this.InitialControlArray();

                //起動時共通処理
                base.StartProgram();
                Btn_F6.Text = "";

                if (Kidou.Equals(1))
                {
                    //単独起動でない場合、ファンクション名は「戻る」
                    Btn_F1.Text  = "F1:戻る";
                    Btn_F12.Text = "F12:確定";
                }
                //コンボボックス初期化
                string ymd = bbl.GetDate();
                nnbl = new NyuukinNyuuryoku_BL();
                CboStoreCD.Bind(ymd);

                Scr_Clr(0);

                //スタッフマスター(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;
                }

                detailControls[0].Focus();
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                EndSec();
            }
        }
Ejemplo n.º 7
0
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                InProgramID = ProID;
                InProgramNM = ProNm;

                this.SetFunctionLabel(EProMode.SHOW);   //照会プログラムとして起動
                this.InitialControlArray();

                //起動時共通処理
                base.StartProgram();
                Btn_F6.Text = "";
                Btn_F9.Text = "";

                //コンボボックス初期化
                string ymd = bbl.GetDate();
                mibl = new MiNyuukinKakuninShoukai_BL();
                CboStoreCD.Bind(ymd);
                Bind(CboPaymentMethodCD, 1);

                Scr_Clr(0);

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

                //detailControls[(int)EIndex.ShippingDateFrom].Text = ymd;
                //detailControls[(int)EIndex.ShippingDateTo].Text = ymd;

                detailControls[(int)EIndex.StoreCD].Focus();
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                EndSec();
            }
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                Scr_Clr();
                detailControls[(int)EIndex.DayStart].Text = snbl.GetDate();
                detailControls[(int)EIndex.DayEnd].Text   = snbl.GetDate();

                string ymd = snbl.GetDate();
                CboSoukoCD.Bind(ymd);

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = OperatorCD,
                    ChangeDate = snbl.GetDate()
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    //[M_Souko_Select]
                    M_Souko_Entity me = new M_Souko_Entity
                    {
                        StoreCD    = mse.StoreCD,
                        SoukoType  = "3",
                        ChangeDate = ymd,
                        DeleteFlg  = "0"
                    };

                    DataTable mdt = snbl.M_Souko_SelectForNyuuka(me);
                    if (mdt.Rows.Count > 0)
                    {
                        CboSoukoCD.SelectedValue = mdt.Rows[0]["SoukoCD"];
                    }
                }

                F9Visible = false;
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                //EndSec();
            }
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                base.InProgramID = ProID;
                base.InProgramNM = ProNm;

                this.SetFunctionLabel(EProMode.PRINT);
                this.InitialControlArray();
                base.Btn_F9.Text    = "";
                base.Btn_F9.Enabled = false;
                base.Btn_F10.Text   = "";
                base.Btn_F11.Text   = "";

                //起動時共通処理
                base.StartProgram();

                tabl = new Tanaoroshi_BL();
                string ymd = tabl.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);

                CboSoukoCD.Bind(ymd, mse.StoreCD);

                SetFuncKeyAll(this, "100001000001");
                Scr_Clr(0);
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                EndSec();
            }
        }
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            bool ret;

            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

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

                //日付として正しいこと(Be on the correct date)E103
                if (!mibl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    mibl.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
                            mibl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }

                    ScCustomer.ChangeDate = detailControls[index].Text;
                }


                break;

            case (int)EIndex.StaffCD:
                //入力無くても良い(It is not necessary to input)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScStaff.LabelText = "";
                    return(true);
                }

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Staff_BL bl = new Staff_BL();
                ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;


            case (int)EIndex.CustomerCD:
                //入力無くても良い(It is not necessary to input)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(true);
                }

                //[M_Customer_Select]
                M_Customer_Entity mce = new M_Customer_Entity
                {
                    CustomerCD = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Customer_BL sbl = new Customer_BL();
                ret = sbl.M_Customer_Select(mce);
                if (ret)
                {
                    //ScCustomer.LabelText = mce.CustomerName;
                    if (mOldCustomerCD != detailControls[index].Text)
                    {
                        if (mce.VariousFLG == "1")
                        {
                            detailControls[index + 1].Text    = mce.CustomerName;
                            detailControls[index + 1].Enabled = true;
                        }
                        else
                        {
                            ScCustomer.LabelText = mce.CustomerName;
                            //  detailControls[index + 1].Text = mce.CustomerCD;
                            //// [M_Store_Select]
                            //   M_Store_Entity me = new M_Store_Entity
                            //   {
                            //       StoreCD = mce.LastSalesStoreCD,
                            //      ChangeDate = mce.LastSalesDate
                            //   };
                        }
                    }
                }
                else
                {
                    bbl.ShowMessage("E101");
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(false);
                }

                mOldCustomerCD = detailControls[index].Text;        //位置確認

                break;

            //case (int)EIndex.CustomerName:
            //    //入力可能の場合 入力必須(Entry required)
            //    if (detailControls[index].Enabled && string.IsNullOrWhiteSpace(detailControls[index].Text))
            //    {
            //        //E102
            //        bbl.ShowMessage("E102");
            //        return false;
            //    }
            //    break;

            case (int)EIndex.StoreCD:
                if (CboStoreCD.SelectedValue.Equals("-1"))
                {
                    CboStoreCD.MoveNext = false;
                    bbl.ShowMessage("E102");
                    CboStoreCD.Focus();
                    return(false);
                }
                else
                {
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        CboStoreCD.MoveNext = false;
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }

                break;
            }

            return(true);
        }
Ejemplo n.º 11
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(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 = hsbl.GetDate();

            ScStaff.TxtCode.Text = InOperatorCD;

            txtHacchuuDateFrom.Text = ymd.ToString();
            txtHacchuuDateTo.Text   = ymd.ToString();

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

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

            //[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();
            }

            //未印刷が初期値
            chkInsatuTaishou_Mihakkou.Checked  = true;
            chkInsatuShurui_Hacchhusho.Checked = true;
            chkInsatuShurui_NetHacchuu.Checked = true;
            chkInsatuShurui_Chokusou.Checked   = true;
            chkInsatuShurui_Cancel.Checked     = true;

            detailControls[(int)EIndex.StoreCD].Focus();
        }
        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 = tjbl.FormatDate(detailControls[index].Text);

                //日付として正しいこと(Be on the correct date)E103
                if (!tjbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    tjbl.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
                            tjbl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }

                break;

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

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

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = tjbl.GetDate()     // detailControls[(int)EIndex.MitsumoriDate].Text
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    tjbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;

                //case (int)EIndex.MitsumoriName:

                //    break;
            }

            return(true);
        }
        /// <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_RadioButton)))
                {
                    ((RadioButton)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 = "";
                }
            }

            //初期値セット
            string ymd = nnbl.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;
                //パラメータ 基準日:Form.日付,店舗:Form.店舗	,得意先区分:3
                ScCustomer.Value2 = 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();
            }

            ((RadioButton)detailControls[(int)EIndex.RdoZan]).Checked = true;

            GvDetail.DataSource = null;
            GvDetail.Enabled    = false;
        }
Ejemplo n.º 14
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 = zibl.FormatDate(detailControls[index].Text);

                //日付として正しいこと(Be on the correct date)E103
                if (!zibl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    zibl.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
                            zibl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.FromSoukoCD:

                break;

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

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = zibl.GetDate()     // detailControls[(int)EIndex.MitsumoriDate].Text
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    zibl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;
            }

            return(true);
        }
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            if (detailControls[index].GetType().Equals(typeof(CKM_Controls.CKM_TextBox)))
            {
                if (((CKM_Controls.CKM_TextBox)detailControls[index]).isMaxLengthErr)
                {
                    return(false);
                }
            }

            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
            case (int)EIndex.InputDateFrom:
            case (int)EIndex.InputDateTo:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

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

                //日付として正しいこと(Be on the correct date)E103
                if (!bbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    bbl.ShowMessage("E103");
                    return(false);
                }
                //(From) ≧ (To)である場合Error
                if (index == (int)EIndex.DayEnd || index == (int)EIndex.InputDateTo)
                {
                    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)
                        {
                            bbl.ShowMessage("E104");
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.StoreCD:
                //選択必須(Entry required)
                if (!RequireCheck(new Control[] { detailControls[index] }))
                {
                    CboStoreCD.MoveNext = false;
                    return(false);
                }
                else
                {
                    //店舗権限のチェック
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        CboStoreCD.MoveNext = false;
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }

                    //パラメータ 基準日:Form.日付,店舗:Form.店舗	,得意先区分:3
                    ScCustomer.Value2 = CboStoreCD.SelectedValue.ToString();
                }
                break;

            case (int)EIndex.CboSyubetsu:
                //if (CboArrivalPlan.SelectedIndex == -1)
                //{
                //    bbl.ShowMessage("E102");
                //    CboArrivalPlan.Focus();
                //    return false;
                //}
                //else
                //{

                //}
                break;

            case (int)EIndex.CustomerCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {       //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(true);
                }

                //[M_Customer_Select]
                M_Customer_Entity mce = new M_Customer_Entity
                {
                    CustomerCD = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Customer_BL sbl = new Customer_BL();
                bool        ret = sbl.M_Customer_Select(mce);
                if (ret)
                {
                    //if (mce.DeleteFlg == "1")
                    //{
                    //    bbl.ShowMessage("E119");
                    //    //顧客情報ALLクリア
                    //    ClearCustomerInfo();
                    //    return false;
                    //}
                    ScCustomer.LabelText = mce.CustomerName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScCustomer.LabelText = "";
                    return(false);
                }

                break;

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

                //[M_Staff_Select]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Staff_BL stbl = new Staff_BL();
                ret = stbl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }

                break;
            }

            return(true);
        }
Ejemplo n.º 16
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 = ssbl.GetDate();

            //スタッフマスター(M_Staff)に存在すること
            //[M_Staff]
            M_Staff_Entity mse = new M_Staff_Entity
            {
                StaffCD    = OperatorCD,
                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();
            }

            ((CheckBox)detailControls[(int)EIndex.ChkAll]).Checked      = true;
            ((CheckBox)detailControls[(int)EIndex.ChkTujo]).Checked     = true;
            ((CheckBox)detailControls[(int)EIndex.ChkHenpin]).Checked   = true;
            ((CheckBox)detailControls[(int)EIndex.ChkHachuAll]).Checked = true;
            ((CheckBox)detailControls[(int)EIndex.ChkGaisho]).Checked   = true;
            ((CheckBox)detailControls[(int)EIndex.ChkTento]).Checked    = true;
            ((CheckBox)detailControls[(int)EIndex.ChkWeb]).Checked      = true;

            GvDetail.DataSource = null;
            GvDetail.Enabled    = false;
            btnSubF10.Enabled   = false;
        }
Ejemplo n.º 17
0
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            bool ret;

            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
            case (int)EIndex.SalesDateFrom:
            case (int)EIndex.SalesDateTo:
            case (int)EIndex.BillingDateFrom:
            case (int)EIndex.BillingDateTo:
            case (int)EIndex.CollectDateFrom:
            case (int)EIndex.CollectDateTo:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

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

                //日付として正しいこと(Be on the correct date)E103
                if (!bbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    bbl.ShowMessage("E103");
                    return(false);
                }
                //見積日(From) ≧ 見積日(To)である場合Error
                if (index == (int)EIndex.DayEnd || index == (int)EIndex.SalesDateTo || index == (int)EIndex.BillingDateTo || index == (int)EIndex.CollectDateTo)
                {
                    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)
                        {
                            bbl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.StoreCD:
                //選択なくてもよい
                if (CboStoreCD.SelectedIndex <= 0)
                {
                    //bbl.ShowMessage("E102");
                    //CboStoreCD.Focus();
                    //return false;
                    return(true);
                }
                else
                {
                    //店舗権限のチェック
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        CboStoreCD.MoveNext = false;
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }
                break;

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

                //[M_Customer_Select]
                M_Customer_Entity mce = new M_Customer_Entity
                {
                    CustomerCD = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Customer_BL sbl = new Customer_BL();
                ret = sbl.M_Customer_Select(mce);
                if (ret)
                {
                    ScCustomer.LabelText = mce.CustomerName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScCustomer.LabelText = "";
                    return(false);
                }

                break;

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

                //[M_VendorCD_Select]
                M_Vendor_Entity mve = new M_Vendor_Entity
                {
                    VendorCD   = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Vendor_BL vbl = new Vendor_BL();
                ret = vbl.M_Vendor_SelectTop1(mve);
                if (ret)
                {
                    ScVendor.LabelText = mve.VendorName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScVendor.LabelText = "";
                    return(false);
                }

                break;

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

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Staff_BL bl = new Staff_BL();
                ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;
            }

            return(true);
        }
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            if (detailControls[index].GetType().Equals(typeof(CKM_Controls.CKM_TextBox)))
            {
                if (((CKM_Controls.CKM_TextBox)detailControls[index]).isMaxLengthErr)
                {
                    return(false);
                }
            }

            bool ret;

            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

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

                //日付として正しいこと(Be on the correct date)E103
                if (!mibl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    mibl.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
                            mibl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }


                break;

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

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Staff_BL bl = new Staff_BL();
                ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;


            case (int)EIndex.CustomerCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(true);
                }

                //[M_Customer_Select]
                M_Customer_Entity mce = new M_Customer_Entity
                {
                    CustomerCD = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Customer_BL sbl = new Customer_BL();
                ret = sbl.M_Customer_Select(mce);
                if (ret)
                {
                    if (mOldCustomerCD != detailControls[index].Text)
                    {
                        if (mce.VariousFLG == "1")
                        {
                            detailControls[index + 1].Text    = mce.CustomerName;
                            detailControls[index + 1].Enabled = true;
                        }
                        else
                        {
                            detailControls[index + 1].Text = mce.CustomerName;

                            //[M_Store_Select]
                            M_Store_Entity me = new M_Store_Entity
                            {
                                StoreCD    = mce.LastSalesStoreCD,
                                ChangeDate = mce.LastSalesDate
                            };
                        }
                    }
                }
                else
                {
                    bbl.ShowMessage("E101");
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(false);
                }

                mOldCustomerCD = detailControls[index].Text;        //位置確認

                break;

            //case (int)EIndex.CustomerName:
            //    //入力可能の場合 入力必須(Entry required)
            //    if (detailControls[index].Enabled && string.IsNullOrWhiteSpace(detailControls[index].Text))
            //    {
            //        //E102
            //        bbl.ShowMessage("E102");
            //        return false;
            //    }
            //    break;

            case (int)EIndex.SalesNO:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                //[D_Sales_SelectData]
                dse         = new D_Sales_Entity();
                dse.SalesNO = detailControls[(int)EIndex.SalesNO].Text;
                DataTable dt = mibl.D_Sales_SelectData(dse, (short)EOperationMode.SHOW);
                //以下の条件で売上入力ーが存在しなければエラー (Error if record does not exist)E133
                if (dt.Rows.Count == 0)
                {
                    bbl.ShowMessage("E133");
                    ScUriageNO.LabelText = "";
                    previousCtrl.Focus();
                    return(false);
                }
                else
                {
                    //権限がない場合(以下のSelectができない場合)Error
                    if (!base.CheckAvailableStores(dt.Rows[0]["StoreCD"].ToString()))
                    {
                        bbl.ShowMessage("E141");
                        ScUriageNO.LabelText = "";
                        previousCtrl.Focus();

                        return(false);
                    }
                }

                break;

            case (int)EIndex.StoreCD:
                //選択必須(Entry required)
                if (!RequireCheck(new Control[] { CboStoreCD }))
                {
                    CboStoreCD.MoveNext = false;
                    return(false);
                }
                else
                {
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        CboStoreCD.MoveNext = false;
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }

                break;
            }

            return(true);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            bool ret;

            switch (index)
            {
            case (int)EIndex.Simebi:
                //入力必須(Entry required)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //E102
                    bbl.ShowMessage("E102");
                    return(false);
                }

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

                //日付として正しいこと(Be on the correct date)E103
                if (!mibl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    mibl.ShowMessage("E103");
                    return(false);
                }

                ScCustomer.ChangeDate = detailControls[index].Text;
                break;

            case (int)EIndex.StaffCD:
                //入力無くても良い(It is not necessary to input)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScStaff.LabelText = "";
                    return(true);
                }

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = detailControls[(int)EIndex.Simebi].Text
                };
                if (string.IsNullOrWhiteSpace(mse.ChangeDate))
                {
                    mse.ChangeDate = bbl.GetDate();
                }

                Staff_BL bl = new Staff_BL();
                ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;


            case (int)EIndex.CustomerCD:
                //入力無くても良い(It is not necessary to input)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(true);
                }

                //[M_Customer_Select]
                M_Customer_Entity mce = new M_Customer_Entity
                {
                    CustomerCD = detailControls[index].Text,
                    ChangeDate = detailControls[(int)EIndex.Simebi].Text
                };
                if (string.IsNullOrWhiteSpace(mce.ChangeDate))
                {
                    mce.ChangeDate = bbl.GetDate();
                }

                Customer_BL sbl = new Customer_BL();
                ret = sbl.M_Customer_Select(mce);
                if (ret)
                {
                    if (mOldCustomerCD != detailControls[index].Text)
                    {
                        if (mce.CollectFLG != "1")
                        {
                            bbl.ShowMessage("E101");
                            //顧客情報ALLクリア
                            ClearCustomerInfo();
                            return(false);
                        }
                        if (mce.VariousFLG == "1")
                        {
                            detailControls[index + 1].Text    = mce.CustomerName;
                            detailControls[index + 1].Enabled = true;
                            ScCustomer.LabelText = mce.CustomerName;
                        }
                        else
                        {
                            detailControls[index + 1].Text = mce.CustomerName;
                            ScCustomer.LabelText           = mce.CustomerName;
                            ////[M_Store_Select]
                            //M_Store_Entity me = new M_Store_Entity
                            //{
                            //    StoreCD = mce.LastSalesStoreCD,
                            //    ChangeDate = mce.LastSalesDate
                            //};
                        }
                    }
                }
                else
                {
                    bbl.ShowMessage("E101");
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(false);
                }

                mOldCustomerCD = detailControls[index].Text;        //位置確認

                break;

            //case (int)EIndex.CustomerName:
            //    //入力可能の場合 入力必須(Entry required)
            //    if (detailControls[index].Enabled && string.IsNullOrWhiteSpace(detailControls[index].Text))
            //    {
            //        //E102
            //        bbl.ShowMessage("E102");
            //        return false;
            //    }
            //    break;

            case (int)EIndex.StoreCD:
                //選択必須(Entry required)
                if (!RequireCheck(new Control[] { CboStoreCD }))
                {
                    CboStoreCD.MoveNext = false;
                    return(false);
                }
                else
                {
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        CboStoreCD.MoveNext = false;
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }

                break;
            }

            return(true);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            bool          ret;
            DataTable     dt;
            EDIHacchuu_BL ble = new EDIHacchuu_BL();

            switch (index)
            {
            case (int)EIndex.StoreCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    bbl.ShowMessage("E102");
                    CboStoreCD.Focus();
                    return(false);
                }
                else
                {
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }

                break;

            case (int)EIndex.SyoriNO:
                //入力不可の場合チェックなし
                if (!detailControls[index].Enabled)
                {
                    return(true);
                }

                //必須入力
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    bbl.ShowMessage("E102");
                    return(false);
                }

                //EDI発注(D_EDIOrder)に存在すること
                //[D_EDIOrder]
                dee = GetEntityForEDIOrder();
                dt  = ble.D_EDIOrder_Select(dee);
                if (dt.Rows.Count == 0)
                {
                    bbl.ShowMessage("E138", "EDI処理番号");
                    return(false);
                }
                else
                {
                    //権限がない場合(以下のSelectができない場合)Error 「権限のないEDI発注番号」
                    if (!base.CheckAvailableStores(dt.Rows[0]["StoreCD"].ToString()))
                    {
                        bbl.ShowMessage("E139", "EDI処理番号");
                        return(false);
                    }
                    break;
                }

            case (int)EIndex.OrderDateFrom:
            case (int)EIndex.OrderDateTo:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                string strYmd = "";
                switch (index)
                {
                default:
                    strYmd = bbl.FormatDate(detailControls[index].Text);
                    break;
                }

                //日付として正しいこと(Be on the correct date)E103
                if (!bbl.CheckDate(strYmd))
                {
                    //E103
                    bbl.ShowMessage("E103");
                    return(false);
                }

                switch (index)
                {
                default:
                    detailControls[index].Text = strYmd;
                    break;
                }

                //発注日(From) ≧ 発注日(To)である場合Error
                if (index == (int)EIndex.OrderDateTo)
                {
                    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)
                        {
                            bbl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.Vendor:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //情報ALLクリア
                    ClearCustomerInfo();
                    return(true);
                }

                //[M_Vendor_Select]
                M_Vendor_Entity mve = new M_Vendor_Entity
                {
                    VendorCD   = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Vendor_BL sbl = new Vendor_BL();
                ret = sbl.M_Vendor_SelectTop1(mve);

                if (ret)
                {
                    ScVendor.LabelText = mve.VendorName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    //顧客情報ALLクリア
                    ClearCustomerInfo();
                    return(false);
                }

                break;

            case (int)EIndex.Staff:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //情報ALLクリア
                    ClearStaffInfo();
                    return(true);
                }

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = bbl.GetDate()
                };
                Staff_BL bl = new Staff_BL();
                ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    if (mse.DeleteFlg == "1")
                    {
                        bbl.ShowMessage("E119");
                        //顧客情報ALLクリア
                        ClearStaffInfo();
                        return(false);
                    }
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    //情報ALLクリア
                    ClearStaffInfo();
                    return(false);
                }
                break;

            case (int)EIndex.OrderNO:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                //発注(D_Order)に存在すること
                //[D_Order]
                string orderNo = detailControls[index].Text;
                dt = ble.D_Order_SelectForEDIHacchuu(orderNo);
                if (dt.Rows.Count == 0)
                {
                    bbl.ShowMessage("E138", "発注番号");
                    return(false);
                }
                else
                {
                    //DeleteDateTime 「削除された発注番号」
                    if (!string.IsNullOrWhiteSpace(dt.Rows[0]["DeleteDateTime"].ToString()))
                    {
                        bbl.ShowMessage("E140", "発注番号");
                        return(false);
                    }

                    //権限がない場合(以下のSelectができない場合)Error 「権限のないEDI発注番号」
                    if (!base.CheckAvailableStores(dt.Rows[0]["StoreCD"].ToString()))
                    {
                        bbl.ShowMessage("E139", "発注番号");
                        return(false);
                    }

                    break;
                }
            }

            return(true);
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                InProgramID = ProID;
                InProgramNM = ProNm;

                this.SetFunctionLabel(EProMode.SHOW);   //照会プログラムとして起動
                this.InitialControlArray();

                //起動時共通処理
                base.StartProgram();
                Btn_F6.Text = "";
                Btn_F9.Text = "";

                //コンボボックス初期化
                string ymd = bbl.GetDate();
                mibl = new HacchuuShouninNyuuryoku_BL();
                CboStoreCD.Bind(ymd);

                string stores = GetAllAvailableStores();

                Scr_Clr(0);

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

                //承認用データを抽出(発注入力と同じ)
                HacchuuNyuuryoku_BL hbl   = new HacchuuNyuuryoku_BL();
                DataTable           dtApp = new DataTable();
                W_ApprovalStageFLG = hbl.GetApprovalStageFLG(InOperatorCD);
                //この一時テーブルにレコードがない=承認する立場にない。←画面に表示すべきデータがないというこちになります。
                if (W_ApprovalStageFLG == 0)
                {
                    EndSec();
                    return;
                }

                detailControls[(int)EIndex.OrderDateFrom].Text = ymd;
                detailControls[(int)EIndex.OrderDateTo].Text   = ymd;

                detailControls[(int)EIndex.StoreCD].Focus();
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                EndSec();
            }
        }
        /// <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 = true;
                }
                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 = ssbl.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)
            {
                //[M_Souko_Search]
                M_Souko_Entity me = new M_Souko_Entity
                {
                    StoreCD    = mse.StoreCD,
                    SoukoType  = "3",
                    ChangeDate = ymd,
                    DeleteFlg  = "0",
                    searchType = "2"
                };

                DataTable mdt = ssbl.M_Souko_Search(me);
                if (mdt.Rows.Count > 0)
                {
                    CboSouko.SelectedValue = mdt.Rows[0]["SoukoCD"];
                }
                else
                {
                    bbl.ShowMessage("E133");
                    EndSec();
                }
            }

            ChkSaihakko.Checked = false;
            detailControls[(int)EIndex.InstructionNO].Enabled = false;
            detailControls[(int)EIndex.DeliveryPlanDate].Text = ymd;

            detailControls[1].Focus();
        }
Ejemplo n.º 23
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 = "";
                }
            }

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


            //初期値セット
            string ymd = ssbl.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();
            }

            ((CheckBox)detailControls[(int)EIndex.ChkMiNyuka]).Checked   = true;
            ((CheckBox)detailControls[(int)EIndex.ChkNyukaZumi]).Checked = true;

            for (int i = (int)EIndex.ChkJuchuAri; i <= (int)EIndex.ChkEdi; i++)
            {
                if (detailControls[i].GetType().Equals(typeof(CKM_Controls.CKM_CheckBox)))
                {
                    ((CheckBox)detailControls[i]).Checked = true;
                }
            }

            GvDetail.DataSource = null;
            GvDetail.Enabled    = false;
            Btn_F10.Enabled     = false;

            detailControls[0].Focus();
        }
Ejemplo n.º 24
0
        /// <summary>
        /// HEAD部のコードチェック
        /// </summary>
        /// <param name="index"></param>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private bool CheckDetail(int index, bool set = true)
        {
            bool ret;

            switch (index)
            {
            case (int)EIndex.HacchuuDateFrom:
                detailControls[index].Text = hsbl.FormatDate(detailControls[index].Text);

                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                //日付として正しいこと(Be on the correct date)E103
                if (!hsbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    hsbl.ShowMessage("E103");
                    return(false);
                }
                break;

            case (int)EIndex.HacchuuDateTo:
                detailControls[index].Text = hsbl.FormatDate(detailControls[index].Text);

                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                //日付として正しいこと(Be on the correct date)E103
                if (!hsbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    hsbl.ShowMessage("E103");
                    return(false);
                }

                DateTime hacchuuDateFrom;
                DateTime hacchuuDateTo;
                DateTime.TryParse(hsbl.FormatDate(detailControls[(int)EIndex.HacchuuDateFrom].Text), out hacchuuDateFrom);
                DateTime.TryParse(hsbl.FormatDate(detailControls[index].Text), out hacchuuDateTo);
                if (hacchuuDateFrom > hacchuuDateTo)
                {
                    hsbl.ShowMessage("E104");
                    return(false);
                }
                break;

            case (int)EIndex.Staff:
                //入力無くても良い(It is not necessary to input)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScStaff.LabelText = "";
                    return(true);
                }

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD = detailControls[index].Text,
                };
                if (string.IsNullOrWhiteSpace(mse.ChangeDate))
                {
                    mse.ChangeDate = bbl.GetDate();
                }

                Staff_BL bl = new Staff_BL();
                ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;


            case (int)EIndex.Vendor:
                //入力無くても良い(It is not necessary to input)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ClearVendorInfo();
                    return(true);
                }

                //[M_Vendor_Select]
                M_Vendor_Entity mce = new M_Vendor_Entity
                {
                    VendorCD = detailControls[index].Text,
                };
                if (string.IsNullOrWhiteSpace(mce.ChangeDate))
                {
                    mce.ChangeDate = bbl.GetDate();
                }

                Vendor_BL sbl = new Vendor_BL();
                ret = sbl.M_Vendor_SelectTop1(mce);
                if (ret)
                {
                    if (mOldVendorCD != detailControls[index].Text)
                    {
                        ScVendor.LabelText = mce.VendorName;
                    }
                }
                else
                {
                    bbl.ShowMessage("E101");
                    ClearVendorInfo();
                    return(false);
                }

                mOldVendorCD = detailControls[index].Text;        //位置確認
                break;

            case (int)EIndex.HacchuuNO:
                //入力必須(Entry required)
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                Hacchuusho_BL hbl = new Hacchuusho_BL();
                var           dt  = hbl.PRC_Hacchuusho_D_Order_SelectByKey(detailControls[index].Text);
                if (dt.Rows.Count == 0)
                {
                    bbl.ShowMessage("E138", "発注番号");
                    return(false);
                }

                if (dt.Rows[0]["DeleteDateTime"] == null)
                {
                    bbl.ShowMessage("E140");
                    return(false);
                }

                //dt = hbl.PRC_Hacchuusho_M_AutorisationCheck();
                //if (dt.Rows.Count == 0)
                //{
                //    bbl.ShowMessage("E139");
                //    return false;
                //}

                mOldVendorCD = detailControls[index].Text;        //位置確認

                break;

            case (int)EIndex.StoreCD:
                if (CboStoreCD.SelectedValue.Equals("-1"))
                {
                    bbl.ShowMessage("E102");
                    CboStoreCD.Focus();
                    return(false);
                }
                else
                {
                    if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString()))
                    {
                        bbl.ShowMessage("E141");
                        CboStoreCD.Focus();
                        return(false);
                    }
                }

                break;
            }

            return(true);
        }
        /// <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 = mibl.GetDate()
            };
            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();
            }

            CboSoukoName.Enabled = false;
            detailControls[1].Focus();
        }
        private bool CheckDetail(int index)
        {
            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
            case (int)EIndex.PlanDateStart:
            case (int)EIndex.PlanDateEnd:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

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

                //日付として正しいこと(Be on the correct date)E103
                if (!snbl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    snbl.ShowMessage("E103");
                    return(false);
                }
                //(From) ≧ (To)である場合Error
                if (index == (int)EIndex.DayEnd || index == (int)EIndex.PlanDateEnd)
                {
                    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
                            snbl.ShowMessage("E104");
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.SoukoCD:
                //選択必須(Entry required)
                if (!RequireCheck(new Control[] { detailControls[index] }))
                {
                    return(false);
                }
                break;

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

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = snbl.GetDate()     // detailControls[(int)EIndex.MitsumoriDate].Text
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    snbl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;

            case (int)EIndex.JuchuuNO:
                //入力された場合
                if (!string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    //受注(D_Juchuu)の存在しない場合エラー
                    D_Juchuu_Entity de = new D_Juchuu_Entity();
                    de.JuchuuNO = detailControls[index].Text;
                    TempoJuchuuNyuuryoku_BL tbl = new TempoJuchuuNyuuryoku_BL();
                    DataTable dt = tbl.D_Juchu_SelectData(de, 2);
                    if (dt.Rows.Count == 0)
                    {
                        bbl.ShowMessage("E138", "受注番号");
                        return(false);
                    }
                    else
                    {
                        //DeleteDateTime 「削除された受注番号」
                        if (!string.IsNullOrWhiteSpace(dt.Rows[0]["DeleteDateTime"].ToString()))
                        {
                            bbl.ShowMessage("E140", "受注番号");
                            return(false);
                        }
                    }
                }
                break;
            }

            return(true);
        }