public string M_Brand_ExistsCheck([FromBody] BrandModel bmodel)
        {
            if (bmodel == null)
            {
                bmodel = new BrandModel();
            }
            Brand_BL Ubl = new Brand_BL();

            return(Ubl.M_Brand_ExistsCheck(bmodel));
        }
        public string M_Brand_Select([FromBody] BrandModel bmodel)
        {
            if (bmodel == null)
            {
                bmodel = new BrandModel();
            }
            Brand_BL Ubl = new Brand_BL();

            return(Ubl.M_Brand_Select(bmodel));
        }
        private void Form_Load(object sender, EventArgs e)
        {
            try
            {
                mbl = new Brand_BL();
                Scr_Clr();

                radioButton1.Focus();
            }
            catch (Exception ex)
            {
                //エラー時共通処理
                MessageBox.Show(ex.Message);
                //EndSec();
            }
        }
        private bool CheckDetail(int index)
        {
            bool ret;

            switch (index)
            {
            case (int)EIndex.VendorCd:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScMaker.LabelText = "";
                    return(true);
                }
                else
                {
                    M_Vendor_Entity mve = new M_Vendor_Entity
                    {
                        VendorCD   = detailControls[index].Text,
                        ChangeDate = string.IsNullOrWhiteSpace(this.ChangeDate) ? sbl.GetDate() : this.ChangeDate,
                        DeleteFlg  = "0"
                    };
                    Vendor_BL vbl = new Vendor_BL();
                    ret = vbl.M_Vendor_SelectTop1(mve);
                    if (ret)
                    {
                        ScMaker.LabelText = mve.VendorName;
                    }
                    else
                    {
                        sbl.ShowMessage("E101");
                        ScMaker.LabelText = "";
                        return(false);
                    }
                }
                break;

            case (int)EIndex.BrandCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScBrand.LabelText = "";
                }
                else
                {
                    //[M_Brand]
                    M_Brand_Entity mme = new M_Brand_Entity
                    {
                        //ChangeDate = string.IsNullOrWhiteSpace(this.ChangeDate) ? sbl.GetDate() : this.ChangeDate,
                        BrandCD = detailControls[index].Text
                    };
                    Brand_BL bbl = new Brand_BL();
                    ret = bbl.M_Brand_Select(mme);
                    if (ret)
                    {
                        ScBrand.LabelText = mme.BrandName;
                    }
                    else
                    {
                        //E101
                        sbl.ShowMessage("E101");
                        ScBrand.LabelText = "";
                        return(false);
                    }
                }
                break;

            case (int)EIndex.SportsCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScSports.LabelText = "";
                }
                else
                {
                    //以下の条件でM_MultiPorposeが存在しない場合、エラー

                    //[M_MultiPorpose]
                    M_MultiPorpose_Entity mme = new M_MultiPorpose_Entity
                    {
                        ID         = MultiPorpose_BL.ID_SPORTS,
                        Key        = detailControls[index].Text,
                        ChangeDate = string.IsNullOrWhiteSpace(this.ChangeDate) ? sbl.GetDate() : this.ChangeDate
                    };
                    MultiPorpose_BL mbl = new MultiPorpose_BL();
                    DataTable       dt  = mbl.M_MultiPorpose_Select(mme);
                    if (dt.Rows.Count > 0)
                    {
                        ScSports.LabelText = dt.Rows[0]["Char1"].ToString();
                    }
                    else
                    {
                        //E101
                        sbl.ShowMessage("E101");
                        ScSports.LabelText = "";
                        return(false);
                    }
                }
                break;

            //case (int)EIndex.ClassificationA:
            //    if (string.IsNullOrWhiteSpace(detailControls[index].Text))
            //    {
            //        scClassificationA.LabelText = "";
            //    }
            //    else
            //    {
            //        //以下の条件でM_ClassificationAが存在しない場合、エラー

            //        //[M_ClassificationA]
            //        M_Classification_Entity mce = new M_Classification_Entity
            //        {
            //            ClassificationA = detailControls[index].Text
            //        };
            //        Classification_BL mbl = new Classification_BL();
            //        ret = mbl.M_ClassificationA_Select(mce);
            //        if (ret)
            //        {
            //            scClassificationA.LabelText = mce.ClassificationAName;
            //        }
            //        else
            //        {
            //            //E101
            //            sbl.ShowMessage("E101");
            //            scClassificationA.LabelText = "";
            //            return false;
            //        }
            //    }
            //    break;
            //case (int)EIndex.ClassificationB:
            //    if (string.IsNullOrWhiteSpace(detailControls[index].Text))
            //    {
            //        scClassificationB.LabelText = "";
            //    }
            //    else
            //    {
            //        //以下の条件でM_ClassificationBが存在しない場合、エラー

            //        //[M_ClassificationB]
            //        M_Classification_Entity mce = new M_Classification_Entity
            //        {
            //            ClassificationA = detailControls[index - 1].Text,
            //            ClassificationB = detailControls[index].Text
            //        };
            //        Classification_BL mbl = new Classification_BL();
            //        ret = mbl.M_ClassificationB_Select(mce);
            //        if (ret)
            //        {
            //            scClassificationA.LabelText = mce.ClassificationAName;
            //            scClassificationB.LabelText = mce.ClassificationBName;
            //        }
            //        else
            //        {
            //            //E101
            //            sbl.ShowMessage("E101");
            //            scClassificationB.LabelText = "";
            //            return false;
            //        }
            //    }
            //    break;

            //case (int)EIndex.ClassificationC:
            //    if (string.IsNullOrWhiteSpace(detailControls[index].Text))
            //    {
            //        scClassificationC.LabelText = "";
            //    }
            //    else
            //    {
            //        //以下の条件でM_ClassificationCが存在しない場合、エラー

            //        //[M_ClassificationC]
            //        M_Classification_Entity mce = new M_Classification_Entity
            //        {
            //            ClassificationA = detailControls[index - 2].Text,
            //            ClassificationB = detailControls[index - 1].Text,
            //            ClassificationC = detailControls[index].Text
            //        };
            //        Classification_BL mbl = new Classification_BL();
            //        ret = mbl.M_ClassificationC_Select(mce);
            //        if (ret)
            //        {
            //            scClassificationA.LabelText = mce.ClassificationAName;
            //            scClassificationB.LabelText = mce.ClassificationBName;
            //            scClassificationC.LabelText = mce.ClassificationCName;
            //        }
            //        else
            //        {
            //            //E101
            //            sbl.ShowMessage("E101");
            //            scClassificationC.LabelText = "";
            //            return false;
            //        }
            //    }
            //    break;
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
            case (int)EIndex.InputStart:
            case (int)EIndex.InputEnd:
            case (int)EIndex.UpdateStart:
            case (int)EIndex.UpdateEnd:

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

                detailControls[index].Text = this.sbl.FormatDate(detailControls[index].Text);

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

                break;
            }

            return(true);
        }
        public string Brand_CUD([FromBody] BrandModel bmodel)
        {
            Brand_BL Ubl = new Brand_BL();

            return(Ubl.Brand_CUD(bmodel));
        }