Example #1
0
        /// <summary>
        /// 出荷入力更新処理
        /// NyuukaNyuuryokuより更新時に使用
        /// </summary>
        /// <param name="dme"></param>
        /// <param name="operationMode"></param>
        /// <returns></returns>
        public bool D_Shipping_Exec(D_Shipping_Entity dse, DataTable dt, short operationMode, string storeCD)
        {
            string sp = "PRC_ShukkaNyuuryoku";

            command                = new SqlCommand(sp, GetConnection());
            command.CommandType    = CommandType.StoredProcedure;
            command.CommandTimeout = 0;
            AddParam(command, "@OperateMode", SqlDbType.Int, operationMode.ToString());
            AddParam(command, "@ShippingNO", SqlDbType.VarChar, dse.ShippingNO);
            AddParam(command, "@ShippingDate", SqlDbType.VarChar, dse.ShippingDate);
            AddParam(command, "@ShippingKBN", SqlDbType.TinyInt, dse.ShippingKBN);
            AddParam(command, "@StoreCD", SqlDbType.VarChar, storeCD);
            AddParam(command, "@InstructionNO", SqlDbType.VarChar, dse.InstructionNO);
            AddParam(command, "@SoukoCD", SqlDbType.VarChar, dse.SoukoCD);
            AddParam(command, "@CarrierCD", SqlDbType.VarChar, dse.CarrierCD);
            AddParam(command, "@StaffCD", SqlDbType.VarChar, dse.StaffCD);
            AddParam(command, "@UnitsCount", SqlDbType.TinyInt, dse.UnitsCount);
            AddParamForDataTable(command, "@Table", SqlDbType.Structured, dt);
            AddParam(command, "@Operator", SqlDbType.VarChar, dse.InsertOperator);
            AddParam(command, "@PC", SqlDbType.VarChar, dse.PC);
            //OUTパラメータの追加
            string outPutParam = "@OutShippingNO";

            command.Parameters.Add(outPutParam, SqlDbType.VarChar, 11);
            command.Parameters[outPutParam].Direction = ParameterDirection.Output;
            UseTransaction = true;
            bool ret = InsertUpdateDeleteData(sp, ref outPutParam);

            if (ret)
            {
                dse.ShippingNO = outPutParam;
            }
            return(ret);
        }
Example #2
0
        /// <summary>
        ///出荷入力 出荷番号チェック
        /// </summary>
        /// <param name="ShippingNO"></param>
        /// <returns></returns>
        public DataTable CheckShipping(D_Shipping_Entity de)
        {
            string sp = "CheckShipping";
            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@ShippingNO", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.ShippingNO
                  } },
            };

            return(SelectData(dic, sp));
        }
        /// <summary>
        /// 出荷済み・売上済みチェック
        /// </summary>
        /// <param name="D_Shipping_Entity"></param>
        /// <param name="errno"></param>
        /// <returns></returns>
        public bool CheckShukkaData(D_Shipping_Entity de, out string errno)
        {
            DataTable dt = dsdl.CheckShukkaData(de);

            bool ret = true;

            errno = "";

            if (dt.Rows.Count > 0)
            {
                errno = dt.Rows[0]["errno"].ToString();
            }

            return(ret);
        }
        private D_Shipping_Entity GetSearchInfo()
        {
            //エラーで落ちるので、スペースは省く
            string skuCD = string.Empty;

            string[] arr = detailControls[(int)EIndex.SKUCD].Text.Split(',');
            for (int i = 0; i < arr.Length; i++)
            {
                if (!string.IsNullOrWhiteSpace(arr[i]))
                {
                    if (skuCD != string.Empty)
                    {
                        skuCD += ",";
                    }

                    skuCD += arr[i];
                }
            }

            string janCD = string.Empty;

            arr = detailControls[(int)EIndex.JanCD].Text.Split(',');
            for (int i = 0; i < arr.Length; i++)
            {
                if (!string.IsNullOrWhiteSpace(arr[i]))
                {
                    if (janCD != string.Empty)
                    {
                        janCD += ",";
                    }
                    janCD += arr[i];
                }
            }


            dse = new D_Shipping_Entity
            {
                ShippingDateFrom = detailControls[(int)EIndex.DayStart].Text,
                ShippingDateTo   = detailControls[(int)EIndex.DayEnd].Text,
                SoukoCD          = CboSoukoCD.SelectedValue.ToString().Equals("-1") ? string.Empty : CboSoukoCD.SelectedValue.ToString(),

                SKUCD = skuCD, //カンマ区切り
                JanCD = janCD, //カンマ区切り
            };

            return(dse);
        }
Example #5
0
        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"));
        }
        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;
            }

            dse = GetSearchInfo();
            DataTable dt = snbl.D_Shipping_SelectAll(dse);

            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");
            }
        }
Example #7
0
        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;
                }
            }
        }
Example #8
0
        /// <summary>
        /// 出荷番号検索
        /// </summary>
        /// <param name="de"></param>
        /// <returns></returns>
        public DataTable D_Shipping_SelectAll(D_Shipping_Entity de)
        {
            string sp = "D_Shipping_SelectAll";
            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@ShippingDateFrom", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.ShippingDateFrom
                  } },
                { "@ShippingDateTo", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.ShippingDateTo
                  } },
                { "@SoukoCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.SoukoCD
                  } },
                { "@SKUCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.SKUCD
                  } },
                { "@JanCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.JanCD
                  } },
            };

            return(SelectData(dic, sp));
        }
 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));
 }
        /// <summary>
        /// 出荷取得処理
        /// ShukkaNyuuryokuより出荷データ抽出時に使用
        /// 新規時以外
        /// </summary>
        public DataTable D_Shipping_SelectData(D_Shipping_Entity de)
        {
            DataTable dt = dsdl.D_Shipping_SelectData(de);

            return(dt);
        }
        /// <summary>
        /// 出荷データチェック取得処理
        /// </summary>
        public DataTable CheckShipping(D_Shipping_Entity de)
        {
            DataTable dt = dsdl.CheckShipping(de);

            return(dt);
        }
 /// <summary>
 /// 出荷入力更新処理
 /// ShukkaNyuuryokuより更新時に使用
 /// </summary>
 public bool Shipping_Exec(D_Shipping_Entity dse, DataTable dt, short operationMode, string storeCD)
 {
     return(dsdl.D_Shipping_Exec(dse, dt, operationMode, storeCD));
 }
 /// <summary>
 /// 出荷番号検索にて使用
 /// </summary>
 /// <param name="de"></param>
 /// <returns></returns>
 public DataTable D_Shipping_SelectAll(D_Shipping_Entity de)
 {
     return(dsdl.D_Shipping_SelectAll(de));
 }
Example #14
0
        /// <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();
                    }
                }
            }
        }