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(); } }
public Search_EDIHacchuuNO(string changeDate) { InitializeComponent(); InitialControlArray(); HeaderTitleText = ProNm; this.Text = ProNm; CboStoreCD.Bind(changeDate); ehbl = new EDIHacchuu_BL(); }
/// <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); }