/// <summary> /// 出荷指示入力更新処理 /// ShukkaShijiTourokuより更新時に使用 /// </summary> /// <param name="die"></param> /// <param name="operationMode"></param> /// <returns></returns> public bool D_Instruction_Exec(D_Instruction_Entity die, DataTable dt) { string sp = "PRC_ShukkaShijiTouroku"; command = new SqlCommand(sp, GetConnection()); command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 0; AddParam(command, "@StoreCD", SqlDbType.VarChar, die.StoreCD); AddParamForDataTable(command, "@Table", SqlDbType.Structured, dt); AddParam(command, "@Operator", SqlDbType.VarChar, die.InsertOperator); AddParam(command, "@PC", SqlDbType.VarChar, die.PC); //OUTパラメータの追加 string outPutParam = "@OutInstructionNO"; command.Parameters.Add(outPutParam, SqlDbType.VarChar, 11); command.Parameters[outPutParam].Direction = ParameterDirection.Output; UseTransaction = true; bool ret = InsertUpdateDeleteData(sp, ref outPutParam); if (ret) { die.InstructionNO = outPutParam; } return(ret); }
private D_Instruction_Entity GetSearchInfo() { die = new D_Instruction_Entity { InstructionDateFrom = detailControls[(int)EIndex.DayStart].Text, InstructionDateTo = detailControls[(int)EIndex.DayEnd].Text, DeliveryPlanDateFrom = detailControls[(int)EIndex.PlanDateStart].Text, DeliveryPlanDateTo = detailControls[(int)EIndex.PlanDateEnd].Text, DeliveryName = detailControls[(int)EIndex.DeliveryName].Text, PrintStaffCD = ScStaff.TxtCode.Text, JuchuuNO = ScJuchuuNO.TxtCode.Text, DeliverySoukoCD = CboSouko.SelectedValue.ToString().Equals("-1") ? string.Empty : CboSouko.SelectedValue.ToString(), }; if (ckM_CheckBox1.Checked) { die.Chk1 = 1; } else { die.Chk1 = 0; } if (ckM_CheckBox2.Checked) { die.Chk2 = 1; } else { die.Chk2 = 0; } if (ckM_CheckBox3.Checked) { die.Chk3 = 1; } else { die.Chk3 = 0; } if (ckM_CheckBox4.Checked) { die.Chk4 = 1; } else { die.Chk4 = 0; } if (ckM_CheckBox5.Checked) { die.Chk5 = 1; } else { die.Chk5 = 0; } return(die); }
/// <summary> /// 出荷指示番号検索 /// </summary> /// <param name="die"></param> /// <returns></returns> public DataTable D_Instruction_SelectAll(D_Instruction_Entity die) { string sp = "D_Instruction_SelectAll"; Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@InstructionDateFrom", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.@InstructionDateFrom } }, { "@InstructionDateTo", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.InstructionDateTo } }, { "@DeliveryPlanDateFrom", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryPlanDateFrom } }, { "@DeliveryPlanDateTo", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryPlanDateTo } }, { "@SoukoCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliverySoukoCD } }, { "@Chk1", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk1.ToString() } }, { "@Chk2", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk2.ToString() } }, { "@Chk3", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk3.ToString() } }, { "@Chk4", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk4.ToString() } }, { "@Chk5", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk5.ToString() } }, { "@DeliveryName", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryName } }, { "@CarrierCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.CarrierCD } }, { "@JuchuuNO", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.JuchuuNO } }, { "@StaffCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.PrintStaffCD } }, }; return(SelectData(dic, sp)); }
/// <summary> /// 出荷入力データチェック処理 /// ShukkaNyuuryokuより出荷指示データチェック時に使用 /// </summary> public DataTable CheckInstruction(D_Instruction_Entity de) { string sp = "CheckInstruction"; Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@InstructionNO", new ValuePair { value1 = SqlDbType.VarChar, value2 = de.InstructionNO } }, }; return(SelectData(dic, sp)); }
/// <summary> /// 出荷指示書より出荷指示データの存在チェック /// </summary> /// <param name="de"></param> /// <returns></returns> public bool D_Instruction_Select(D_Instruction_Entity de) { DataTable dt = ddl.D_Instruction_Select(de); if (dt.Rows.Count > 0) { return(true); } else { return(false); } }
/// <summary> /// 出荷指示書より出荷指示データの存在チェック /// </summary> /// <param name="die"></param> /// <returns></returns> public DataTable D_Instruction_Select(D_Instruction_Entity die) { string sp = "D_Instruction_Select"; Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@InstructionNO", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.InstructionNO } }, { "@SoukoCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliverySoukoCD } }, }; return(SelectData(dic, sp)); }
/// <summary> /// 出荷指示書発行済みFLGの更新処理 /// </summary> /// <param name="de"></param> /// <param name="dt"></param> /// <returns></returns> public bool D_Instruction_Update(D_Instruction_Entity de, DataTable dt) { string sp = "D_Instruction_Update"; command = new SqlCommand(sp, GetConnection()); command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 0; AddParamForDataTable(command, "@Table", SqlDbType.Structured, dt); AddParam(command, "@Operator", SqlDbType.VarChar, de.UpdateOperator); AddParam(command, "@PC", SqlDbType.VarChar, de.PC); UseTransaction = true; string outPutParam = ""; //未使用 bool ret = InsertUpdateDeleteData(sp, ref outPutParam); return(ret); }
/// <summary> /// 出荷入力データ取得処理 /// ShukkaNyuuryokuより出荷指示データ抽出時に使用 /// 新規時 /// </summary> public DataTable D_Instruction_SelectDataForShukka(D_Instruction_Entity de, string shippingDate) { string sp = "D_Instruction_SelectDataForShukka"; Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@InstructionNO", new ValuePair { value1 = SqlDbType.VarChar, value2 = de.InstructionNO } }, { "@ShippingDate", new ValuePair { value1 = SqlDbType.VarChar, value2 = shippingDate } }, }; return(SelectData(dic, sp)); }
/// <summary> /// 出荷指示入力データ取得処理 /// ShukkaShijiTourokuよりデータ抽出時に使用 /// </summary> public DataTable D_Instruction_SelectData(D_Instruction_Entity die) { string sp = "D_Instruction_SelectData"; Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@DeliveryPlanDateFrom", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryPlanDateFrom } }, { "@DeliveryPlanDateTo", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryPlanDateTo } }, { "@StoreCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.StoreCD } }, { "@Chk1", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk1.ToString() } }, { "@Chk2", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk2.ToString() } }, { "@Chk3", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk3.ToString() } }, { "@Chk4", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk4.ToString() } }, { "@Chk5", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk5.ToString() } }, { "@DeliveryName", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryName } }, { "@ChkHakkozumi", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.ChkHakkozumi.ToString() } }, { "@ChkSyukkazumi", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.ChkSyukkazumi.ToString() } }, }; return(SelectData(dic, sp)); }
/// </summary> /// <param name="die"></param> /// <returns></returns> public DataTable D_Instruction_SelectForPrint(D_Instruction_Entity die) { string sp = "D_Instruction_SelectForPrint"; Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@DeliveryPlanDate", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliveryPlanDate } }, { "@SoukoCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.DeliverySoukoCD } }, { "@Chk1", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk1.ToString() } }, { "@Chk2", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk2.ToString() } }, { "@Chk3", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk3.ToString() } }, { "@Chk4", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk4.ToString() } }, { "@Chk5", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.Chk5.ToString() } }, { "@CarrierCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.CarrierCD } }, { "@InstructionNO", new ValuePair { value1 = SqlDbType.VarChar, value2 = die.InstructionNO } }, { "@ChkMihakko", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.ChkMihakko.ToString() } }, { "@ChkSaihakko", new ValuePair { value1 = SqlDbType.TinyInt, value2 = die.ChkSaihakko.ToString() } }, }; return(SelectData(dic, sp)); }
protected override void ExecDisp() { bool exists = false; for (int i = 0; i < detailControls.Length; i++) { if (i != (int)EIndex.SoukoCD && !string.IsNullOrWhiteSpace(detailControls[i].Text)) { exists = true; } if (CheckDetail(i) == false) { detailControls[i].Focus(); return; } } if (!exists) { snbl.ShowMessage("E111"); detailControls[0].Focus(); return; } die = GetSearchInfo(); DataTable dt = snbl.D_Instruction_SelectAll(die); GvDetail.DataSource = dt; if (dt.Rows.Count > 0) { GvDetail.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; GvDetail.CurrentRow.Selected = true; GvDetail.Enabled = true; GvDetail.Focus(); } else { snbl.ShowMessage("E128"); } }
public void F11() { if (ErrorCheck()) { mshe = new D_Shipping_Entity { SoukoCD = cboWarehouse.SelectedValue.ToString(), ShippingDateFrom = txtShippingStartDate.Text, ShippingDateTo = txtShippingEndDate.Text, CarrierCD = cboShipping.SelectedValue.ToString(), ShippingKBN = CheckValue1(), InvoiceNO = CheckValue2(), }; dsde = new D_ShippingDetails_Entity { Number = SC_Order.TxtCode.Text, SKUCD = Sc_SKUCD.TxtCode.Text, JanCD = SC_JanCD.TxtCode.Text, ItemCD = Sc_Item.TxtCode.Text, }; die = new D_Instruction_Entity { DeliverySoukoCD = cboDestinationWarehouse.SelectedValue.ToString(), }; dtSearch = skskbl.D_Shipping_Select(mshe, dsde, die); if (dtSearch.Rows.Count == 0) { skskbl.ShowMessage("E128"); cboWarehouse.Focus(); } else { dgvShukkaShoukai.DataSource = dtSearch; } } }
/// <summary> /// 出荷指示データチェック取得処理 /// </summary> public DataTable CheckInstruction(D_Instruction_Entity de) { DataTable dt = didl.CheckInstruction(de); return(dt); }
/// <summary> /// to export Excel File /// </summary> private void F10() { if (ErrorCheck()) { mshe = new D_Shipping_Entity { SoukoCD = cboWarehouse.SelectedValue.ToString(), ShippingDateFrom = txtShippingStartDate.Text, ShippingDateTo = txtShippingEndDate.Text, CarrierCD = cboShipping.SelectedValue.ToString(), ShippingKBN = CheckValue1(), InvoiceNO = CheckValue2(), }; dsde = new D_ShippingDetails_Entity { Number = SC_Order.TxtCode.Text, SKUCD = Sc_SKUCD.TxtCode.Text, JanCD = SC_JanCD.TxtCode.Text, ItemCD = Sc_Item.TxtCode.Text, }; die = new D_Instruction_Entity { DeliverySoukoCD = cboDestinationWarehouse.SelectedValue.ToString(), }; dtSearch = skskbl.D_Shipping_Select(mshe, dsde, die); if (dtSearch.Rows.Count > 0) { DataTable dtExport = dtSearch; dtExport = ChangeDataColumnName(dtExport); SaveFileDialog savedialog = new SaveFileDialog(); savedialog.Filter = "Excel Files|*.xlsx;"; savedialog.Title = "Save"; savedialog.FileName = "ExportFile"; savedialog.InitialDirectory = @"C:\"; savedialog.RestoreDirectory = true; if (savedialog.ShowDialog() == DialogResult.OK) { if (Path.GetExtension(savedialog.FileName).Contains(".xlsx")) { Microsoft.Office.Interop.Excel._Application excel = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel._Workbook workbook = excel.Workbooks.Add(Type.Missing); Microsoft.Office.Interop.Excel._Worksheet worksheet = null; worksheet = workbook.ActiveSheet; worksheet.Name = "ExportedFromDatGrid"; using (XLWorkbook wb = new XLWorkbook()) { wb.Worksheets.Add(dtExport, "test"); wb.SaveAs(savedialog.FileName); skskbl.ShowMessage("I203", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); //Export Successful } } Clear(); dgvShukkaShoukai.DataSource = string.Empty; cboWarehouse.Focus(); } } } }
/// <summary> /// 出荷入力取得処理 /// ShukkaNyuuryokuより出荷指示データ抽出時に使用 /// 新規時 /// </summary> public DataTable D_Instruction_SelectDataForShukka(D_Instruction_Entity de, string shippingDate) { DataTable dt = didl.D_Instruction_SelectDataForShukka(de, shippingDate); return(dt); }
/// <summary> /// 出荷指示書発行済みFLGの更新処理 /// </summary> /// <param name="de"></param> /// <param name="dt"></param> /// <returns></returns> public bool D_Instruction_Update(D_Instruction_Entity de, DataTable dt) { return(ddl.D_Instruction_Update(de, dt)); }
/// <summary> /// 出荷指示入力更新処理 /// ShukkaShijiTourokuより更新時に使用 /// </summary> public bool D_Instruction_Exec(D_Instruction_Entity die, DataTable dt) { return(ddl.D_Instruction_Exec(die, dt)); }
/// <summary> /// 出荷指示書の印刷データ取得処理 /// </summary> /// <param name="de"></param> /// <returns></returns> public DataTable D_Instruction_SelectForPrint(D_Instruction_Entity de) { return(ddl.D_Instruction_SelectForPrint(de)); }
/// <summary> /// 出荷指示データ取得処理 /// </summary> /// <param name="set">画面展開なしの場合:falesに設定する</param> /// <returns></returns> private DataTable CheckData(out DataTable dtForUpdate) { dtForUpdate = null; for (int i = 0; i < detailControls.Length; i++) { if (CheckDetail(i, false) == false) { detailControls[i].Focus(); return(null); } } //未発行分選択時、 通常~店舗間移動(CheckBox)のすべてがOFFの時、Error bool okFlg = true; if (ChkMihakko.Checked) { okFlg = false; for (int i = (int)EIndex.Chk1; i <= (int)EIndex.Chk5; i++) { if (((CheckBox)detailControls[i]).Checked) { okFlg = true; } } } if (!okFlg) { //E180 bbl.ShowMessage("E180"); detailControls[(int)EIndex.Chk1].Focus(); return(null); } //[D_Ins_SelectForPrint] die = GetEntity(); DataTable dt = ssbl.D_Instruction_SelectForPrint(die); //以下の条件でデータが存在しなければエラー (Error if record does not exist)E133 if (dt.Rows.Count == 0) { bbl.ShowMessage("E133"); previousCtrl.Focus(); return(null); } else { //明細にデータをセット int i = 0; dtForUpdate = new DataTable(); dtForUpdate.Columns.Add("no", Type.GetType("System.String")); foreach (DataRow row in dt.Rows) { if (mOldInstructionNO != row["InstructionNO"].ToString()) { bool ret = SelectAndInsertExclusive(row["InstructionNO"].ToString()); if (!ret) { return(null); } i++; mOldInstructionNO = row["InstructionNO"].ToString(); // データを追加 DataRow rowForUpdate; rowForUpdate = dtForUpdate.NewRow(); rowForUpdate["no"] = row["InstructionNO"].ToString(); dtForUpdate.Rows.Add(rowForUpdate); } } } return(dt); }
/// <summary> /// 仕入番号検索にて使用 /// </summary> /// <param name="de"></param> /// <returns></returns> public DataTable D_Instruction_SelectAll(D_Instruction_Entity de) { return(ddl.D_Instruction_SelectAll(de)); }
/// <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.DeliveryPlanDate: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { //入力可能時 if (detailControls[index].Enabled) { //E102 bbl.ShowMessage("E102"); return(false); } else { return(true); } } 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; break; case (int)EIndex.InstructionNO: if (string.IsNullOrWhiteSpace(detailControls[index].Text)) { //印刷対象 再発行分CheckBox=ONの時 //入力必須(Entry required) if (ChkSaihakko.Checked) { //E102 bbl.ShowMessage("E102"); return(false); } else { return(true); } } //[D_Instruction_Select] D_Instruction_Entity de = new D_Instruction_Entity { InstructionNO = detailControls[index].Text , DeliverySoukoCD = CboSouko.SelectedValue.ToString().Equals("-1") ? string.Empty : CboSouko.SelectedValue.ToString(), }; ret = ssbl.D_Instruction_Select(de); if (!ret) { //該当データなし bbl.ShowMessage("E128"); return(false); } break; case (int)EIndex.SoukoCD: //選択必須(Entry required) if (!RequireCheck(new Control[] { detailControls[index] })) { CboSouko.MoveNext = false; return(false); } break; } return(true); }
/// <summary> /// 出荷指示入力取得処理 /// ShukkaShijiTourokuよりデータ抽出時に使用 /// </summary> public DataTable D_Instruction_SelectData(D_Instruction_Entity de) { DataTable dt = ddl.D_Instruction_SelectData(de); return(dt); }
private D_Instruction_Entity GetEntity() { die = new D_Instruction_Entity { DeliveryPlanDate = detailControls[(int)EIndex.DeliveryPlanDate].Text, DeliverySoukoCD = CboSouko.SelectedValue.ToString().Equals("-1") ? string.Empty : CboSouko.SelectedValue.ToString(), InstructionNO = detailControls[(int)EIndex.InstructionNO].Text, CarrierCD = CboCarrierCD.SelectedIndex > 0 ? CboCarrierCD.SelectedValue.ToString(): string.Empty, UpdateOperator = InOperatorCD, PC = InPcID }; if (ChkMihakko.Checked) { die.ChkMihakko = 1; } else { die.ChkMihakko = 0; } if (ChkSaihakko.Checked) { die.ChkSaihakko = 1; } else { die.ChkSaihakko = 0; } if (ChkNohinSeikyu.Checked) { die.ChkNohinSeikyu = 1; } else { die.ChkNohinSeikyu = 0; } if (ckM_CheckBox1.Checked) { die.Chk1 = 1; } else { die.Chk1 = 0; } if (ckM_CheckBox2.Checked) { die.Chk2 = 1; } else { die.Chk2 = 0; } if (ckM_CheckBox3.Checked) { die.Chk3 = 1; } else { die.Chk3 = 0; } if (ckM_CheckBox4.Checked) { die.Chk4 = 1; } else { die.Chk4 = 0; } if (ckM_CheckBox5.Checked) { die.Chk5 = 1; } else { die.Chk5 = 0; } return(die); }
public DataTable D_Shipping_Select(D_Shipping_Entity dhse, D_ShippingDetails_Entity dsde, D_Instruction_Entity die) { return(dsdl.D_Shipping_Select(dhse, dsde, die)); }
public DataTable D_Shipping_Select(D_Shipping_Entity dshe, D_ShippingDetails_Entity dsde, D_Instruction_Entity die) { Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair> { { "@SoukoCD", new ValuePair { value1 = SqlDbType.NVarChar, value2 = dshe.SoukoCD } }, { "@ShippingStartDate", new ValuePair { value1 = SqlDbType.Date, value2 = dshe.ShippingDateFrom.Replace("/", "-") } }, { "@ShippingEndDate", new ValuePair { value1 = SqlDbType.Date, value2 = dshe.ShippingDateTo.Replace("/", "-") } }, { "@Number", new ValuePair { value1 = SqlDbType.VarChar, value2 = dsde.Number } }, { "@DeliverySoukoCD", new ValuePair { value1 = SqlDbType.NVarChar, value2 = die.DeliverySoukoCD } }, { "@CarrierCD", new ValuePair { value1 = SqlDbType.NVarChar, value2 = dshe.CarrierCD } }, { "@ITEMCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = dsde.ItemCD } }, { "@JanCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = dsde.JanCD } }, { "@SKUCD", new ValuePair { value1 = SqlDbType.VarChar, value2 = dsde.SKUCD } }, { "@ShippingKBN", new ValuePair { value1 = SqlDbType.TinyInt, value2 = dshe.ShippingKBN } }, { "@InvoiceNO", new ValuePair { value1 = SqlDbType.TinyInt, value2 = dshe.InvoiceNO } }, }; UseTransaction = true; return(SelectData(dic, "D_Shipping_Select")); }