public Search_Vendor(string ChangeDate, string VendorKBN) { InitializeComponent(); txtChangeDate.Text = ChangeDate; F9Visible = false; vbl = new Vendor_BL(); lblVendorKBN.Text = VendorKBN; F11Visible = false; dgvSearchVendor.DisabledColumn("colVendorCD,colVendorName,Column3,Column4,colChangeDate"); }
private bool CheckDetail(int index) { switch (index) { case (int)EIndex.MakerCD: //入力なければチェックなし if (detailControls[index].Text == "") { ScMaker.LabelText = ""; return(true); } else { //仕入先マスタデータチェック Vendor_BL mbl = new Vendor_BL(); M_Vendor_Entity mse = new M_Vendor_Entity { VendorCD = detailControls[index].Text, ChangeDate = ckM_Label1.Text }; bool ret = mbl.M_Vendor_SelectTop1(mse); if (ret) { ScMaker.LabelText = mse.VendorName; } else { //E136 mbl.ShowMessage("E136"); ScMaker.LabelText = ""; return(false); } } break; case (int)EIndex.BrandName: 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) { bool ret; switch (index) { case (int)EIndex.OrderDateFrom: case (int)EIndex.OrderDateTo: case (int)EIndex.ArrivalPlanDateFrom: case (int)EIndex.ArrivalPlanDateTo: case (int)EIndex.ArrivalPlanMonthFrom: case (int)EIndex.ArrivalPlanMonthTo: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { return(true); } string strYmd = ""; switch (index) { case (int)EIndex.ArrivalPlanMonthFrom: case (int)EIndex.ArrivalPlanMonthTo: strYmd = bbl.FormatDate(detailControls[index].Text + "/01"); break; 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) //{ // case (int)EIndex.ArrivalPlanMonthFrom: // case (int)EIndex.ArrivalPlanMonthTo: // detailControls[index].Text = strYmd.Substring(0, 7); // break; // default: // detailControls[index].Text = strYmd; // break; //} //見積日(From) ≧ 見積日(To)である場合Error if (index == (int)EIndex.OrderDateTo || index == (int)EIndex.ArrivalPlanDateTo || index == (int)EIndex.ArrivalPlanMonthTo) { 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); } } } //発注日のどちらかに入力があった場合に、未確定分、完売、不要のチェックボックスの入力を可能にする if (!string.IsNullOrWhiteSpace(detailControls[(int)EIndex.OrderDateFrom].Text) || !string.IsNullOrWhiteSpace(detailControls[(int)EIndex.OrderDateTo].Text)) { ChkMikakutei.Enabled = true; ChkKanbai.Enabled = true; ChkFuyo.Enabled = true; } break; case (int)EIndex.OrderCD: //入力無くても良い(It is not necessary to input) 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, VendorFlg = "1", ChangeDate = bbl.GetDate() }; Vendor_BL sbl = new Vendor_BL(); ret = sbl.M_Vendor_SelectTop1(mve); if (ret) { if (mve.DeleteFlg == "1") { bbl.ShowMessage("E119"); //顧客情報ALLクリア ClearCustomerInfo(); return(false); } ScOrderCD.LabelText = mve.VendorName; } else { bbl.ShowMessage("E101"); //顧客情報ALLクリア ClearCustomerInfo(); return(false); } break; case (int)EIndex.StoreCD: //選択必須(Entry required) if (!RequireCheck(new Control[] { detailControls[index] })) { return(false); } else { if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString())) { bbl.ShowMessage("E141"); CboStoreCD.Focus(); 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.ArrivalPlanDateFrom: case (int)EIndex.ArrivalPlanDateTo: case (int)EIndex.ArrivalDateFrom: case (int)EIndex.ArrivalDateTo: case (int)EIndex.PurchaseDateFrom: case (int)EIndex.PurchaseDateTo: 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.ArrivalPlanDateTo || index == (int)EIndex.ArrivalDateTo || index == (int)EIndex.PurchaseDateTo) { 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 == -1) { 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.VendorCD: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { ScVendor.LabelText = ""; return(true); } //string ymd = detailControls[(int)EIndex.] //[M_VendorCD_Select] M_Vendor_Entity mce = new M_Vendor_Entity { VendorCD = detailControls[index].Text, VendorFlg = "1", ChangeDate = bbl.GetDate() }; Vendor_BL sbl = new Vendor_BL(); bool ret = sbl.M_Vendor_SelectTop1(mce); if (ret) { ScVendor.LabelText = mce.VendorName; } else { bbl.ShowMessage("E101"); ScVendor.LabelText = ""; return(false); } break; } return(true); }
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); }
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 = 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) { 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"); detailControls[index].Focus(); return(false); } } ScCustomer.ChangeDate = detailControls[index].Text; } break; case (int)EIndex.StoreCD: if (CboStoreCD.SelectedValue.Equals("-1")) { snbl.ShowMessage("E102"); CboStoreCD.Focus(); return(false); } else { //店舗権限のチェック、引数で処理可能店舗の配列をセットしたい if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString())) { snbl.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 = 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.VendorCD: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { ScCustomer.LabelText = ""; return(true); } //[M_VendorCD_Select] M_Vendor_Entity mce = new M_Vendor_Entity { VendorCD = detailControls[index].Text, ChangeDate = snbl.GetDate() }; Vendor_BL sbl = new Vendor_BL(); ret = sbl.M_Vendor_SelectTop1(mce); if (ret) { ScCustomer.LabelText = mce.VendorName; } else { snbl.ShowMessage("E101"); ScCustomer.LabelText = ""; return(false); } break; } return(true); }
/// <summary> /// コードチェック /// </summary> /// <param name="index"></param> /// <returns></returns> private bool CheckDetail(int index) { 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.MailDateSt: case (int)EIndex.MailDateEd: //必須入力(Entry required)、入力なければエラー(If there is no input, an error)E102 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 (!bbl.CheckDate(detailControls[index].Text)) { //E103 bbl.ShowMessage("E103"); return(false); } //大小チェック //(From) ≧ (To)である場合Error if (index == (int)EIndex.MailDateEd) { if (!string.IsNullOrWhiteSpace(detailControls[(int)EIndex.MailDateSt].Text) && !string.IsNullOrWhiteSpace(detailControls[index].Text)) { int result = detailControls[index].Text.CompareTo(detailControls[(int)EIndex.MailDateSt].Text); if (result < 0) { bbl.ShowMessage("E104"); return(false); } } } break; case (int)EIndex.MailTimeSt: case (int)EIndex.MailTimeEd: //入力無くても良い(It is not necessary to input) if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { return(true); } detailControls[index].Text = FormatTime(detailControls[index].Text); //時刻として正しい if (!CheckTime(detailControls[index].Text)) { //E215 bbl.ShowMessage("E215"); return(false); } //大小チェック //(From) ≧ (To)である場合Error if (index == (int)EIndex.MailTimeEd) { if (!string.IsNullOrWhiteSpace(detailControls[(int)EIndex.MailTimeSt].Text) && !string.IsNullOrWhiteSpace(detailControls[index].Text)) { if (detailControls[(int)EIndex.MailDateSt].Text == detailControls[(int)EIndex.MailDateEd].Text) { int result = detailControls[index].Text.CompareTo(detailControls[(int)EIndex.MailTimeSt].Text); if (result < 0) { bbl.ShowMessage("E104"); return(false); } } } } break; case (int)EIndex.Customer: if (detailControls[index].Enabled) { //入力無くても良い(It is not necessary to input) if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { return(true); } string ymd = mibl.GetDate(); if (ScCustomer.Stype == CKM_SearchControl.SearchType.得意先) { //[M_Customer_Select] M_Customer_Entity mce = new M_Customer_Entity { CustomerCD = detailControls[index].Text, ChangeDate = ymd }; Customer_BL sbl = new Customer_BL(); bool ret = sbl.M_Customer_Select(mce, 1); if (ret) { if (mce.DeleteFlg.Equals("1")) { } ScCustomer.LabelText = mce.CustomerName; } } else { //[M_Vendor_Select] M_Vendor_Entity mve = new M_Vendor_Entity { VendorCD = detailControls[index].Text, VendorFlg = "1", ChangeDate = ymd }; Vendor_BL sbl = new Vendor_BL(); bool ret = sbl.M_Vendor_SelectTop1(mve); if (ret) { } } } 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) { 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) { bool ret; switch (index) { case (int)EIndex.ArrivalPlanDateFrom: case (int)EIndex.ArrivalPlanDateTo: if (index == (int)EIndex.ArrivalPlanDateFrom) { if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { return(true); } } else { //必須入力(Entry required)、入力なければエラー(If there is no input, an error)E102 if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { //E102 bbl.ShowMessage("E102"); return(false); } } string strYmd = ""; strYmd = bbl.FormatDate(detailControls[index].Text); //日付として正しいこと(Be on the correct date)E103 if (!bbl.CheckDate(strYmd)) { //E103 bbl.ShowMessage("E103"); return(false); } detailControls[index].Text = strYmd; //見積日(From) ≧ 見積日(To)である場合Error if (index == (int)EIndex.ArrivalPlanDateTo) { 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); } } ScOrder.ChangeDate = strYmd; } break; case (int)EIndex.OrderCD: //入力無くても良い(It is not necessary to input) 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, VendorFlg = "1", ChangeDate = bbl.GetDate() }; Vendor_BL sbl = new Vendor_BL(); ret = sbl.M_Vendor_SelectTop1(mve); if (ret) { if (mve.DeleteFlg == "1") { bbl.ShowMessage("E119"); //顧客情報ALLクリア ClearCustomerInfo(); return(false); } ScOrder.LabelText = mve.VendorName; } else { bbl.ShowMessage("E101"); //顧客情報ALLクリア ClearCustomerInfo(); 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); }
/// <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 bool CheckDetail(int index) { switch (index) { case (int)EIndex.DayStart: case (int)EIndex.DayEnd: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { return(true); } detailControls[index].Text = ehbl.FormatDate(detailControls[index].Text); //日付として正しいこと(Be on the correct date)E103 if (!ehbl.CheckDate(detailControls[index].Text)) { //E103 ehbl.ShowMessage("E103"); return(false); } //処理日(From) ≧ 処理日(To)である場合Error if (index == (int)EIndex.DayEnd) { if (!string.IsNullOrWhiteSpace(detailControls[index - 1].Text) && !string.IsNullOrWhiteSpace(detailControls[index].Text)) { int result = detailControls[index].Text.CompareTo(detailControls[index - 1].Text); if (result < 0) { //E106 ehbl.ShowMessage("E104"); detailControls[index].Focus(); return(false); } } } break; case (int)EIndex.StoreCD: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { ehbl.ShowMessage("E102"); CboStoreCD.Focus(); return(false); } else { //店舗権限のチェック、引数で処理可能店舗の配列をセットしたい if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString())) { ehbl.ShowMessage("E141"); CboStoreCD.Focus(); return(false); } } break; case (int)EIndex.VendorCD: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { ScVendor.LabelText = ""; return(true); } //仕入先マスター(M_Vendor)に存在すること //[M_Vendor] M_Vendor_Entity mve = new M_Vendor_Entity { VendorCD = detailControls[index].Text, ChangeDate = ehbl.GetDate(), VendorFlg = "1" }; Vendor_BL bl = new Vendor_BL(); bool ret = bl.M_Vendor_SelectTop1(mve); if (ret) { ScVendor.LabelText = mve.VendorName; } else { ehbl.ShowMessage("E101"); ScVendor.LabelText = ""; return(false); } break; } return(true); }
/// <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); }