protected override void ExecDisp() { try { //【取込履歴】 M_MultiPorpose_Entity me = new M_MultiPorpose_Entity { ID = MultiPorpose_BL.ID_ShukkaUriageUpdate, Key = "1" }; MultiPorpose_BL mbl = new MultiPorpose_BL(); DataTable dt = mbl.M_MultiPorpose_Select(me); if (dt.Rows.Count > 0) { string time = Convert.ToInt16(dt.Rows[0]["Num1"]).ToString("D4"); ckM_TextBox1.Text = time.Substring(0, 2) + ":" + time.Substring(2, 2); } else { ////E101 //bbl.ShowMessage("E101"); //EndSec(); ckM_TextBox1.Text = ""; } Scr_Clr(0); //更新履歴情報データ取得処理 dt = sbl.D_Shipping_SelectAllForShoukai(); GvDetail.DataSource = dt; if (dt.Rows.Count > 0) { GvDetail.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; GvDetail.CurrentRow.Selected = true; GvDetail.Enabled = true; GvDetail.Focus(); } else { //bbl.ShowMessage("E128"); } } catch (Exception ex) { //エラー時共通処理 MessageBox.Show(ex.Message); //EndSec(); } }
protected override void ExecDisp() { mbl = new MultiPorpose_BL(); bool ret = BindGrid(); if (ret) { dgvDetail.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; dgvDetail.CurrentRow.Selected = true; dgvDetail.Enabled = true; dgvDetail.Focus(); } else { mbl.ShowMessage("E128"); } }
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); }
protected override void ExecSec() { try { //【取込履歴】 M_MultiPorpose_Entity me = new M_MultiPorpose_Entity { ID = MultiPorpose_BL.ID_Mail, Key = "1" }; MultiPorpose_BL mbl = new MultiPorpose_BL(); DataTable dt = mbl.M_MultiPorpose_Select(me); if (dt.Rows.Count > 0) { mEdiMode = dt.Rows[0]["Num1"].ToString(); if (mEdiMode == "1") { //汎用マスター. 数字型1=1なら、「処理実行中」として青色 lblEdiMode.Text = "処理実行中"; lblEdiMode.BackColor = Color.DeepSkyBlue; } else { //汎用マスター. 数字型1=0なら、「処理停止中」として黄色 lblEdiMode.Text = "処理停止中"; lblEdiMode.BackColor = Color.Yellow; } } else { //E101 bbl.ShowMessage("E101"); EndSec(); } for (int i = 0; i < detailControls.Length; i++) { if (CheckDetail(i) == false) { detailControls[i].Focus(); return; } } //履歴データ取得処理 D_Mail_Entity de = new D_Mail_Entity { MailDateFrom = detailControls[(int)EIndex.MailDateSt].Text, MailDateTo = detailControls[(int)EIndex.MailDateEd].Text, MailTimeFrom = detailControls[(int)EIndex.MailTimeSt].Text != "" ? detailControls[(int)EIndex.MailDateSt].Text + " " + detailControls[(int)EIndex.MailTimeSt].Text + ":00":"", MailTimeTo = detailControls[(int)EIndex.MailTimeEd].Text != "" ? detailControls[(int)EIndex.MailDateEd].Text + " " + detailControls[(int)EIndex.MailTimeEd].Text + ":00" : "", MailType = ckM_ComboBox1.SelectedIndex > 0 ? ckM_ComboBox1.SelectedValue.ToString(): "0", MailKBN = ckM_ComboBox2.SelectedIndex > 0 ? ckM_ComboBox2.SelectedValue.ToString() : "0", CustomerCD = detailControls[(int)EIndex.Customer].Text, VendorCD = detailControls[(int)EIndex.Customer].Text, }; dt = mibl.D_Mail_SelectAll(de); GvDetail.DataSource = dt; if (dt.Rows.Count > 0) { GvDetail.SelectionMode = DataGridViewSelectionMode.FullRowSelect; GvDetail.CurrentRow.Selected = true; GvDetail.Enabled = true; GvDetail.ReadOnly = true; GvDetail.Focus(); } else { bbl.ShowMessage("E128"); } } catch (Exception ex) { //エラー時共通処理 MessageBox.Show(ex.Message); //EndSec(); } }
protected override void ExecSec() { try { //【取込履歴】 M_MultiPorpose_Entity me = new M_MultiPorpose_Entity { ID = MultiPorpose_BL.ID_EDI, Key = "1" }; MultiPorpose_BL mbl = new MultiPorpose_BL(); DataTable dt = mbl.M_MultiPorpose_Select(me); if (dt.Rows.Count > 0) { //[999日間の履歴を保持しています] lblRireki.Text = dt.Rows[0]["Num3"].ToString() + "日間の履歴を保持しています"; mEdiMode = dt.Rows[0]["Num1"].ToString(); if (mEdiMode == "1") { //汎用マスター. 数字型1=1なら、「処理実行中」として青色 lblEdiMode.Text = "処理実行中"; lblEdiMode.BackColor = Color.DeepSkyBlue; } else { //汎用マスター. 数字型1=0なら、「処理停止中」として黄色 lblEdiMode.Text = "処理停止中"; lblEdiMode.BackColor = Color.Yellow; } } else { //E101 bbl.ShowMessage("E101"); EndSec(); } Scr_Clr(0); //履歴データ取得処理 dt = mibl.D_Edi_SelectAll(); GvDetail.DataSource = dt; if (dt.Rows.Count > 0) { GvDetail.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; GvDetail.CurrentRow.Selected = true; GvDetail.Enabled = true; GvDetail.ReadOnly = false; for (int row = 0; row < GvDetail.RowCount; row++) { for (int col = (int)EColNo.Chk + 1; col < GvDetail.ColumnCount; col++) { GvDetail[col, row].ReadOnly = true; } } GvDetail.Focus(); } else { bbl.ShowMessage("E128"); } } catch (Exception ex) { //エラー時共通処理 MessageBox.Show(ex.Message); //EndSec(); } }