public override void FunctionProcess(int index) { CKM_SearchControl sc = new CKM_SearchControl(); switch (index + 1) { case 2: ChangeMode(EOperationMode.INSERT); break; case 6: if (bbl.ShowMessage("Q004") == DialogResult.Yes) { ChangeMode(EOperationMode.INSERT); cboProcessType.Focus(); } break; //case 11: // F11(); // break; case 12: F12(); break; } }
private bool ErrorCheck(int kbn = 0) { string ymd = bbl.GetDate(); if (kbn <= 1) { //割引率 //入力必須(Entry required) if (string.IsNullOrWhiteSpace(txtRitsu.Text)) { //E102 bbl.ShowMessage("E102"); txtRitsu.Focus(); return(false); } txtRitsu.Text = bbl.Z_SetStr(txtRitsu.Text); //100以下であること if (bbl.Z_Set(txtRitsu.Text) > 100) { bbl.ShowMessage("E102"); txtRitsu.Focus(); return(false); } //単価=(100-割引率)/ 100 1円未満は四捨五入 lblTanka.Text = bbl.Z_SetStr(GetResultWithHasuKbn((int)HASU_KBN.SISYAGONYU, bbl.Z_Set(lblTeika.Text) * (100 - bbl.Z_Set(txtRitsu.Text)) / 100)); } return(true); }
public void Save() { if (ErrorCheck()) { if (bbl.ShowMessage("Q201") == DialogResult.Yes) { var keys = string.Join("-", Array.ConvertAll <object, string>(dtreporttemp.Rows[0].ItemArray, Convert.ToString)); // var keys = dtreporttemp.Rows[0].ItemArray.ToString(); ; CR_regi.Youshi youshi = new CR_regi.Youshi(dtreporttemp, new string[] { InOperatorCD, InProgramID, InPcID, "Printed Mode", keys }); youshi.ShowDialog(); // Show Report } } }
public override void FunctionProcess(int index) { base.FunctionProcess(index); switch (index + 1) { case 6: if (bbl.ShowMessage("Q004") == DialogResult.Yes) { Clear(Panel_Details); chkYes.Checked = true; txtTagetFrom.Focus(); cboStore.SelectedValue = StoreCD; } break; } }
public override void FunctionProcess(int index) { base.FunctionProcess(index); switch (index + 1) { case 6: if (bbl.ShowMessage("Q004") == DialogResult.Yes) { Clear(); } break; case 11: F11(); break; } }
private void btnClose_Click(object sender, EventArgs e) { if (bbl.ShowMessage("Q003") == DialogResult.Yes) { this.Close(); } else { btnClose.Focus(); } }
private bool ErrorCheck() { //必須入力(Entry required)、入力なければエラー(If there is no input, an error)E102 if (string.IsNullOrWhiteSpace(txtSalesDate.Text)) { //E102 bbl.ShowMessage("E102"); txtSalesDate.Focus(); return(false); } txtSalesDate.Text = bbl.FormatDate(txtSalesDate.Text); //日付として正しいこと(Be on the correct date)E103 if (!bbl.CheckDate(txtSalesDate.Text)) { //E103 bbl.ShowMessage("E103"); txtSalesDate.Focus(); return(false); } //入力できる範囲内の日付であること if (!bbl.CheckInputPossibleDate(txtSalesDate.Text)) { //E115 bbl.ShowMessage("E115"); txtSalesDate.Focus(); return(false); } //過去日付でないこと //共通処理-日付チェック-会計チェック if (!bbl.CheckInputPossibleDateWithFisicalMonth(txtSalesDate.Text)) { //E115 bbl.ShowMessage("E115"); txtSalesDate.Focus(); return(false); } return(true); }
private void Tennic_MainMenu_FormClosing(object sender, FormClosingEventArgs e) { BL.Base_BL bbl = new Base_BL(); if (bbl.ShowMessage("Q003") == DialogResult.Yes) { e.Cancel = false; } else { e.Cancel = true; } }
public void Save() { if (!String.IsNullOrWhiteSpace(txtprintprogress.Text)) { if (ErrorCheck()) { if (InputErrorCheck()) { if (bbl.ShowMessage("Q201") == DialogResult.Yes) { var keys = string.Join("-", Array.ConvertAll <object, string>(dtreporttemp.Rows[0].ItemArray, Convert.ToString)); try { CR_regi.Youshi youshi = new CR_regi.Youshi(dtreporttemp, new string[] { InOperatorCD, InProgramID, InPcID, "PRINT", txtprintprogress.Text }); youshi.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.InnerException.Source + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Message); } } } } else { bbl.ShowMessage("E138"); } txtprintprogress.Focus(); } else { bbl.ShowMessage("E102"); txtprintprogress.Focus(); } }
public void Main_Menu_FormClosing(object sender, FormClosingEventArgs e) { BL.Base_BL bbl = new Base_BL(); if (bbl.ShowMessage("Q003") == DialogResult.Yes) { ForceToClose(); e.Cancel = false; } else { e.Cancel = true; } }
/// <summary> /// Confirm message on Menu FormClosing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmMenu_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { Base_BL bbl = new Base_BL(); if (bbl.ShowMessage("Q003") == DialogResult.Yes) { e.Cancel = false; } else { e.Cancel = true; } } }
public override void FunctionProcess(int index) { base.FunctionProcess(index); switch (index + 1) { case 6: if (bbl.ShowMessage("Q004") == DialogResult.Yes) { Clear(PanelHeader); txtPurchaseDateFrom.Focus(); } break; case 11: F11(); break; } }
private void F11() { msku_Entity = GetDataEntity(); dap_Entity = GetData(); DataTable dt = pa_bl.Search_PlanArrival(dap_Entity, msku_Entity, adminNO); if (dt.Rows.Count > 0) { GV_PlanArrival.Refresh(); GV_PlanArrival.DataSource = dt; } else { GV_PlanArrival.DataSource = null; bbl.ShowMessage("E128"); } }
private void RightButton_Text(string Text, int TabIndex) { var getDataa = menu.Select("Char1 = '" + Text + "' and BusinessSEQ ='" + TabIndex.ToString() + "'").CopyToDataTable(); //var getDataa = menu.Select("Char1 = '" + Text + "'").CopyToDataTable(); getDataa.DefaultView.Sort = "ProgramSEQ asc"; getDataa.AcceptChanges(); IOrderedEnumerable <DataRow> result; result = getDataa.Select().OrderBy(row => row["ProgramSEQ"]); var getData = result.CopyToDataTable(); if (getData.Rows.Count > 14) // remove after processing { for (int k = 0; k < (getData.Rows.Count); k++) { if (getData.Rows.Count > 14) { getData.Rows.RemoveAt(getData.Rows.Count - 1); } else { break; } } //MessageBox.Show("Menu item is over 14 and the extra menus can not be shown!"); bbl.ShowMessage("I319"); } if (getData.Rows.Count < 15) { if (getData != null) { ButtonText(panel_right, getData, 0); } } else { MessageBox.Show("Too Much Menu Items Occurred!!!"); } }
/// <summary> /// F1からF12までボタンをクリックする場合管理する処理 /// </summary> /// <param name="Index"></param> public override void FunctionProcess(int index) { base.FunctionProcess(index); switch (index + 1) { case 6: //F6:キャンセル if (bbl.ShowMessage("Q004") == DialogResult.Yes) { ClearDetail(); } break; //case 10: // F10(); // break; case 11: //Excel出力 break; //case 12://印刷 // break; } }
/// <summary> /// 仕入先の履歴を表示されること /// </summary> private void sc_SupplierName_CodeKeyDownEvent(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { scMakerCD.ChangeDate = bbl.GetDate(); if (!string.IsNullOrEmpty(scMakerCD.TxtCode.Text)) { if (scMakerCD.SelectData()) { scMakerCD.Value1 = scMakerCD.TxtCode.Text; scMakerCD.Value2 = scMakerCD.LabelText; } else { bbl.ShowMessage("E101"); scMakerCD.SetFocus(1); } } } }
/// <summary> /// 済チェックボックスをクリックする時”1”をセットする /// </summary> /// <summary> /// 未チェックボックスをクリックする時”0”をセットする /// </summary> /// <summary> /// Export Data Csv File /// </summary> /// <remarks>CSVEXELフィールに出す事</remarks> private void ExportCSV() { if (!ErrorCheck()) { return; } if (bbl.ShowMessage("Q203") == DialogResult.No) { return; } string filePath = ""; if (!ShowSaveFileDialog(InProgramNM, out filePath)) { return; } if (dgvPurchaseSearch.DataSource != null) { //Build the CSV file data as a Comma separated string. string csv = string.Empty; //LoacalDirectory string folderPath = "C:\\CSV\\"; FileInfo logFileInfo = new FileInfo(folderPath); DirectoryInfo logDirInfo = new DirectoryInfo(logFileInfo.DirectoryName); if (!logDirInfo.Exists) { logDirInfo.Create(); } //Add the Header row for CSV file. foreach (DataGridViewColumn column in dgvPurchaseSearch.Columns) { //if(column.HeaderText!="") csv += column.HeaderText + ','; } //Add new line. csv += "\r\n"; //Adding the Rows foreach (DataGridViewRow row in dgvPurchaseSearch.Rows) { foreach (DataGridViewCell cell in row.Cells) { //Add the Data rows. if (cell.Value == null) { cell.Value = ""; } //csv += cell.Value.ToString().Replace(",", ";")+ ','; csv += cell.Value.ToString().Replace(",", "") + ','; } //Add new line. csv += "\r\n"; } //Exporting to CSV. File.WriteAllText(folderPath + "仕入照会(仕入先) " + System.DateTime.Today.ToString("MM-dd-yyyy") + "." + "csv", csv, Encoding.GetEncoding(932)); dpurchase_bl.ShowMessage("I203"); //MessageBox.Show("CSV 出力が完了します。", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { dpurchase_bl.ShowMessage("E138"); // MessageBox.Show("There is no data for CSV Export", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { isEnterKeyDown = true; MoveNext = true; isMaxLengthErr = false; if (txt == null) { if ((IsRequire && string.IsNullOrWhiteSpace(Text))) { if (this.Parent is UserControl) { UserControl uc = this.Parent as UserControl; (uc.Controls.Find("lblName", true)[0] as Label).Text = string.Empty; } ShowErrorMessage("E102"); return; } else if (CtrlType == Type.Date && !DateCheck()) { return; } else if (CtrlType == Type.Number && !NumberCheck()) { return; } else if (CtrlType == Type.Price && !PriceCheck()) { return; } else if (CtrlType == Type.YearMonth && !YearMonthCheck()) { return; } else if ((CtrlType == Type.Normal || CtrlType == Type.Number)) { if (this.Parent is UserControl) /// PTK like in Search Con // Master Con { if (CtrlType == Type.Normal) { string str1 = Encoding.GetEncoding(932).GetByteCount(Text).ToString(); if (Convert.ToInt32(str1) > MaxLength)//lenght_ //Added by PTK { MessageBox.Show("入力された文字が長すぎます", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); isMaxLengthErr = true; this.Focus(); return; } } if (CtrlByte == Bytes.半角)//CtrlByte.Equals("半角") { int byteCount = Encoding.GetEncoding("Shift_JIS").GetByteCount(Text); int onebyteCount = System.Text.ASCIIEncoding.ASCII.GetByteCount(Text); if (onebyteCount != byteCount) { MessageBox.Show("入力された文字が長すぎます", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); isMaxLengthErr = true; this.Focus(); return; } } } else // PTK Added { Control_Check(); } } base.OnKeyDown(e); } else if (!string.IsNullOrWhiteSpace(txt.Text)) { if (IsRequire && string.IsNullOrWhiteSpace(Text)) { if (this.Parent is UserControl) { UserControl uc = this.Parent as UserControl; (uc.Controls.Find("lblName", true)[0] as Label).Text = string.Empty; } ShowErrorMessage("E102"); return; } else if (CtrlType == Type.Date && !DateCheck()) { return; } else if (CtrlType == Type.Number && !NumberCheck()) { return; } else if (CtrlType == Type.YearMonth && !YearMonthCheck()) { return; } base.OnKeyDown(e); } if (IsReversecheck && string.IsNullOrWhiteSpace(txt1.Text)) { if (!string.IsNullOrWhiteSpace(Text)) { if (txt1.Parent is UserControl) { UserControl uc = this.Parent as UserControl; (uc.Controls.Find("lblName", true)[0] as Label).Text = string.Empty; } bbl.ShowMessage("E102"); txt1.Focus(); } else if (CtrlType == Type.Date && !DateCheck()) { return; } else if (CtrlType == Type.Number && !NumberCheck()) { return; } else if (CtrlType == Type.YearMonth && !YearMonthCheck()) { return; } base.OnKeyDown(e); } } else { base.OnKeyDown(e); } }
private bool ErrorCheck() { if (!string.IsNullOrWhiteSpace(txtRecordDateFrom.Text) && !string.IsNullOrWhiteSpace(txtRecordDateTo.Text)) { DateTime dt1 = Convert.ToDateTime(txtRecordDateFrom.Text); DateTime dt2 = Convert.ToDateTime(txtRecordDateTo.Text); if (dt1 > dt2) { skhnobl.ShowMessage("E104"); txtRecordDateTo.Focus(); return(false); } } if (!string.IsNullOrWhiteSpace(txtEntryDateFrom.Text) && !string.IsNullOrWhiteSpace(txtEntryDateTo.Text)) { DateTime dt1 = Convert.ToDateTime(txtEntryDateFrom.Text); DateTime dt2 = Convert.ToDateTime(txtEntryDateTo.Text); if (dt1 > dt2) { skhnobl.ShowMessage("E104"); txtEntryDateTo.Focus(); return(false); } } if (!string.IsNullOrWhiteSpace(txtPaymentDateFrom.Text) && !string.IsNullOrWhiteSpace(txtPaymentDateTo.Text)) { DateTime dt1 = Convert.ToDateTime(txtPaymentDateFrom.Text); DateTime dt2 = Convert.ToDateTime(txtPaymentDateTo.Text); if (dt1 > dt2) { skhnobl.ShowMessage("E104"); txtPaymentDateTo.Focus(); return(false); } } if (!string.IsNullOrWhiteSpace(txtPaymentDueDateFrom.Text) && !string.IsNullOrWhiteSpace(txtPaymentDueDateTo.Text)) { DateTime dt1 = Convert.ToDateTime(txtPaymentDueDateFrom.Text); DateTime dt2 = Convert.ToDateTime(txtPaymentDueDateTo.Text); if (dt1 > dt2) { skhnobl.ShowMessage("E104"); txtPaymentDueDateTo.Focus(); return(false); } } if (!String.IsNullOrEmpty(PaymentCD.TxtCode.Text)) { if (!PaymentCD.IsExists(2)) { bbl.ShowMessage("E101"); PaymentCD.SetFocus(1); return(false); } } //<remark>支払済、未支払のどちらもチェックが入っていない場合、エラー<remark> if (chkPaid.Checked == false && chkUnpaid.Checked == false) { skhnobl.ShowMessage("E111"); chkPaid.Focus(); return(false); } if (!String.IsNullOrEmpty(scStaffCD.TxtCode.Text)) { if (!scStaffCD.IsExists(2)) { bbl.ShowMessage("E101"); scStaffCD.SetFocus(1); return(false); } } //zco //<remark>支払済、未支払両方チェックする場合、エラー<remark> //if (chkPaid.Checked == true && chkUnpaid.Checked == true) //{ // MessageBox.Show("Please! Check only one Checkbox.", "Message"); // chkPaid.Focus(); // return false; //} return(true); }
/// <summary> /// 起動時共通処理 /// /// check Authorization /// insert to log(form open) /// </summary> /// <remarks>プログラム起動時に呼び出してください</remarks> protected void StartProgram() { //共通処理 受取パラメータ、接続情報 //コマンドライン引数より情報取得 //Iniファイルより情報取得 //this.GetCmdLine() == false || if (this.GetCmdLine() == false || loginbl.ReadConfig() == false) { //起動時エラー DB接続不可能 this.Close(); System.Environment.Exit(0); } //共通処理 Operator 確認 //[M_Staff] M_Staff_Entity mse = new M_Staff_Entity { StaffCD = InOperatorCD }; mse = loginbl.M_Staff_InitSelect(mse); // MessageBox.Show(bbl.GetConnectionString()); this.lblOperatorName.Text = mse.StaffName; //this.lblLoginDate.Text = mse.SysDate; DataTable dtShopName = bbl.SimpleSelect1("42", null, "222", "1"); this.lblShopName.Text = dtShopName.Rows[0]["Char1"].ToString(); M_Store_Entity mste = new M_Store_Entity { SysDate = mse.SysDate }; mste = loginbl.M_Store_InitSelect(mse, mste); this.lblStoreName.Text = mste.StoreName; StoreCD = mste.StoreCD; ChangeDate = mste.SysDate; //共通処理 プログラム //KTP - 2019-05-29 ProgramのチェックはM_Authorizations_AccessCheck にやっています。 //[M_Program] //mpe = new M_Program_Entity //{ // ProgramID = InProgramID, // Type = "1" //仮 //}; //bool ret = loginbl.M_Program_InitSelect(mpe); //if (ret == false) //{ // //S012 // bbl.ShowMessage("S012"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); //} //Authorizations判断 M_Authorizations_Entity mae; mae = new M_Authorizations_Entity { ProgramID = this.InProgramID, StaffCD = InOperatorCD, PC = InPcID }; made = bbl.M_Authorizations_AccessCheck(mae); if (made == null) { bbl.ShowMessage(mae.MessageID); //起動時エラー this.Close(); System.Environment.Exit(0); } //KTP 2019-05-29 Set ProgrameName, ProgramID this.Text = made.ProgramID; //lblHeaderTitle.Text = made.ProgramName; //KTP 2019-05-29 M_Authorizations_AccessCheckにやっています。 line no 513 to 521 //Program type判断 //switch (mpe.Type) //{ // case "1": // if (made.Insertable == "0" && made.Updatable == "0" && made.Deletable == "0" && made.Inquirable == "0") // { // //S003 // bbl.ShowMessage("S003"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); // } // break; // case "2": // if (made.Printable == "0") // { // //S003 // bbl.ShowMessage("S003"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); // } // break; // case "3": // if (made.Printable == "0" && made.Outputable == "0") // { // //S003 // bbl.ShowMessage("S003"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); // } // break; // case "4": // if (made.Outputable == "0") // { // //S003 // bbl.ShowMessage("S003"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); // } // break; // case "5": // if (made.Inquirable == "0") // { // //S003 // bbl.ShowMessage("S003"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); // } // break; // case "6": // if (made.Runable == "0") // { // //S003 // bbl.ShowMessage("S003"); // //起動時エラー // this.Close(); // System.Environment.Exit(0); // } // break; //} //処理可能店舗 //[M_StoreAuthorizations] M_StoreAuthorizations_Entity msa = new M_StoreAuthorizations_Entity(); msa.StoreAuthorizationsCD = made.StoreAuthorizationsCD; DataTable dt = bbl.M_StoreAuthorizations_Select(msa); if (dt.Rows.Count > 0) { availableStores = new string[dt.Rows.Count]; int i = 0; foreach (DataRow row in dt.Rows) { availableStores[i] = row["StoreCD"].ToString(); i++; } } ///Added by ETZ ,To close when StoreAuthorization isn't accessed else { bbl.ShowMessage(mae.MessageID); //起動時エラー this.Close(); System.Environment.Exit(0); } //プログラム起動履歴 //InsertLog(Get_L_Log_Entity(true)); //KTP 2019-05-29 Program Type Select from M_Authorizations_AccessCheck function //Todo:入力プログラム以外を考慮 //switch (mpe.Type) //switch (made.ProgramType) //{ // case "1": // if (made.Insertable == "1") // { // // 新規ボタン押下処理 // FunctionProcess((int)EOperationMode.INSERT); // } // else if (made.Updatable == "1") // { // // 修正ボタン押下処理 // FunctionProcess((int)EOperationMode.UPDATE); // } // else if (made.Deletable == "1") // { // // 削除ボタン押下処理 // FunctionProcess((int)EOperationMode.DELETE); // } // else // { // // 照会ボタン押下処理 // FunctionProcess((int)EOperationMode.SHOW); // } // break; //} }
private void F11() { if (ErrorCheck()) { if (CKB_searchsuru.Checked == true && RB_item.Checked == true) { type = 1; } else if (CKB_searchsuru.Checked == true && RB_Makashohincd.Checked == true) { type = 2; } else { type = 3; } msku_Entity = GetDataEntity(); msInfo_Entity = GetInfoEntity(); msT_Entity = GetTagEntity(); ds_Entity = GetStockEntity(); dtData = zaibl.ZaikoShoukai_Search(msku_Entity, msInfo_Entity, msT_Entity, ds_Entity, type); if (dtData.Rows.Count > 0) { GV_Zaiko.Refresh(); GV_Zaiko.DataSource = dtData; adminno = dtData.Rows[0]["AdminNo"].ToString(); soukocd = dtData.Rows[0]["倉庫CD"].ToString(); } else { GV_Zaiko.DataSource = null; bbl.ShowMessage("E128"); dtData.Clear(); } } }