private void Form_Load(object sender, EventArgs e) { try { base.InProgramID = ProID; base.InProgramNM = ProNm; this.SetFunctionLabel(EProMode.SHOW); //照会プログラムとして起動 this.InitialControlArray(); //起動時共通処理 base.StartProgram(); Btn_F12.Text = "F12:新規入金"; //初期値セット nnbl = new NyuukinNyuuryoku_BL(); string ymd = nnbl.GetDate(); CboStoreCD.Bind(ymd); CboArrivalPlan.Bind(ymd); //パラメータ 基準日:Form.日付,店舗:Form.店舗 ,得意先区分:3 ScCustomer.Value1 = "3"; SetFuncKeyAll(this, "100001000011"); //画面転送表00に従って、画面情報を表示(Display screen information according to "画面転送表00") Scr_Clr(0); detailControls[0].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_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; }
private bool CheckDetail(int index) { switch (index) { case (int)EIndex.DayStart: case (int)EIndex.DayEnd: case (int)EIndex.InputStart: case (int)EIndex.InputEnd: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { return(true); } detailControls[index].Text = nnbl.FormatDate(detailControls[index].Text); //日付として正しいこと(Be on the correct date)E103 if (!nnbl.CheckDate(detailControls[index].Text)) { //E103 nnbl.ShowMessage("E103"); return(false); } //(From) ≧ (To)である場合Error if (index == (int)EIndex.DayEnd || index == (int)EIndex.InputEnd) { 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 nnbl.ShowMessage("E104"); detailControls[index].Focus(); return(false); } } } break; case (int)EIndex.StoreCD: if (CboStoreCD.SelectedIndex == -1) { nnbl.ShowMessage("E102"); CboStoreCD.Focus(); return(false); } else { //店舗権限のチェック、引数で処理可能店舗の配列をセットしたい if (!base.CheckAvailableStores(CboStoreCD.SelectedValue.ToString())) { nnbl.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 = nnbl.GetDate() // detailControls[(int)EIndex.MitsumoriDate].Text }; Customer_BL sbl = new Customer_BL(); bool ret = sbl.M_Customer_Select(mce); if (ret) { ScCustomer.LabelText = mce.CustomerName; } else { nnbl.ShowMessage("E101"); ScCustomer.LabelText = ""; return(false); } break; } return(true); }