Ejemplo n.º 1
0
        public string Fnc_PlanDate(Fnc_PlanDate_Entity fpe)
        {
            Function_DL fdl = new Function_DL();
            DataTable   dt  = fdl.Fnc_PlanDate(fpe);

            if (dt.Rows.Count > 0)
            {
                fpe.Yoteibi = dt.Rows[0]["Yoteibi"].ToString();

                return(fpe.Yoteibi);
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 2
0
        public DataTable Fnc_PlanDate(Fnc_PlanDate_Entity fpe)
        {
            string sp = "Fnc_PlanDate";
            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@KaisyuShiharaiKbn", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = fpe.KaisyuShiharaiKbn
                  } },
                { "@CustomerCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = fpe.CustomerCD
                  } },
                { "@ChangeDate", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = fpe.ChangeDate
                  } },
                { "@TyohaKbn", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = fpe.TyohaKbn
                  } },
            };

            return(SelectData(dic, sp));
        }
        private bool ErrorCheck(int kbn = 0)
        {
            if (kbn == 1)
            {
                //JANCD
                if (!RequireCheck(new Control[] { txtJanCD }))
                {
                    return(false);
                }

                if (!CheckWidth(1))
                {
                    return(false);
                }

                if (!CheckWidth(2))
                {
                    return(false);
                }

                //【Data Area Detail】に存在するJANCDで無い場合、Error
                DataRow[] rows = dtJuchu.Select("JANCD = '" + txtJanCD.Text + "'");
                if (rows.Length == 0)
                {
                    bbl.ShowMessage("E148");
                    txtJanCD.Focus();
                    return(false);
                }
                else if (rows.Length > 1)
                {
                    //【Data Area Detail】に複数存在するJANCDの場合
                    //「該当する行が複数存在します。右の一覧から選択してください」
                    bbl.ShowMessage("E149");
                    txtJanCD.Focus();
                    return(false);
                }
                else
                {
                    //【Data Area Detail】に1つだけ存在するJANCDの場合
                    //画面転送表01に従って、画面情報を表示
                    //rows[0]よりDataTableのRowIndexを求める
                    int rowindex = dtJuchu.Rows.IndexOf(rows[0]);
                    txtJanCD.Tag = rowindex;

                    SetDataFromDataTable(rowindex + 1);
                }
            }
            if (kbn == 2)
            {
                //出荷数
                //入力無くても良い(It is not necessary to input)
                //入力無い場合、0とする(When there is no input, it is set to 0)
                txtShippingSu.Text = bbl.Z_SetStr(txtShippingSu.Text);

                //入力された場合
                //出荷数>	Form.出荷可能数の場合、Error E150
                if (bbl.Z_Set(txtShippingSu.Text) > bbl.Z_Set(lblSyukkaKanouSu.Text))
                {
                    bbl.ShowMessage("E150");
                    txtShippingSu.Focus();
                    return(false);
                }

                //お買上額等の計算を行う
                //お買上額←form.単価×	出荷数
                lblJuchuuSuu.Text = "\\" + bbl.Z_SetStr(bbl.Z_Set(lblJuchuuUnitPrice.Text.Replace("\\", "")) * bbl.Z_Set(txtShippingSu.Text));

                //うち税額 Function_消費税計算.out金額1
                int    taxRateFLG = Convert.ToInt16(dtJuchu.Rows[(int)txtJanCD.Tag]["TaxRateFLG"]);
                string ymd        = dtJuchu.Rows[(int)txtJanCD.Tag]["JuchuuDate"].ToString();

                decimal zeinukiKin = bbl.GetZeinukiKingaku(bbl.Z_Set(lblJuchuuSuu.Text.Replace("\\", "")), taxRateFLG, ymd);
                lblSalesTax.Text = "\\" + bbl.Z_SetStr(bbl.Z_Set(lblJuchuuSuu.Text.Replace("\\", "")) - zeinukiKin);
            }
            if (kbn == 0 || kbn == 3)
            {
                //お買上日
                //必須入力(Entry required)、入力なければエラー(If there is no input, an error)E102
                if (string.IsNullOrWhiteSpace(txtSalesDate.Text))
                {
                    //E102
                    bbl.ShowMessage("E102");
                    txtSalesDate.Focus();
                    return(false);
                }

                txtSalesDate.Text = bbl.FormatDate(txtSalesDate.Text);

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

                //店舗の締日チェック
                //店舗締マスターで判断
                M_StoreClose_Entity mse = new M_StoreClose_Entity();
                mse.StoreCD      = mStoreCD;
                mse.FiscalYYYYMM = txtSalesDate.Text.Replace("/", "").Substring(0, 6);
                bool ret = tprg_Shukka_Bl.CheckStoreClose(mse, true, false, false, false, true);
                if (!ret)
                {
                    txtSalesDate.Focus();
                    return(false);
                }

                //お買上日から入金予定日を自動計算し表示する(お買上日が変更されたた再計算)
                if (txtSalesDate.Text != mSaleDate)
                {
                    Fnc_PlanDate_Entity fpe = new Fnc_PlanDate_Entity();
                    fpe.KaisyuShiharaiKbn = "0";    // "1";
                    fpe.CustomerCD        = lblCustomerNo.Text;
                    fpe.ChangeDate        = txtSalesDate.Text;
                    fpe.TyohaKbn          = "0";

                    txtFirstCollectPlanDate.Text = bbl.Fnc_PlanDate(fpe);

                    mSaleDate = txtSalesDate.Text;
                }
            }
            if (kbn == 0 || kbn == 4)
            {
                //入金予定日
                //必須入力(Entry required)、入力なければエラー(If there is no input, an error)E102
                if (string.IsNullOrWhiteSpace(txtFirstCollectPlanDate.Text))
                {
                    //E102
                    bbl.ShowMessage("E102");
                    txtFirstCollectPlanDate.Focus();
                    return(false);
                }

                txtFirstCollectPlanDate.Text = bbl.FormatDate(txtFirstCollectPlanDate.Text);
            }

            return(true);
        }