示例#1
0
        /// <summary>
        /// ピッキング入力データ取得処理
        /// PickingNyuuryokuよりデータ抽出時に使用
        /// </summary>
        public DataTable D_Picking_SelectData(D_Picking_Entity de, short operationMode)
        {
            string sp = "D_Picking_SelectData";

            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@OperateMode", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = operationMode.ToString()
                  } },
                { "@PickingNO", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.PickingNO
                  } },
                { "@ShippingPlanDateFrom", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.ShippingPlanDateFrom
                  } },
                { "@ShippingPlanDateTo", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.ShippingPlanDateTo
                  } },
                { "@JuchuuNO", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.JuchuuNO
                  } },
                { "@JanCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.JanCD
                  } },
                { "@SKUCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.SKUCD
                  } },
            };

            return(SelectData(dic, sp));
        }
示例#2
0
        /// <summary>
        /// ピッキング入力更新処理
        /// PickingNyuuryokuより更新時に使用
        /// </summary>
        /// <param name="dme"></param>
        /// <param name="operationMode"></param>
        /// <returns></returns>
        public bool D_Picking_Exec(D_Picking_Entity dme, DataTable dt, short operationMode)
        {
            string sp = "PRC_PickingNyuuryoku";

            command                = new SqlCommand(sp, GetConnection());
            command.CommandType    = CommandType.StoredProcedure;
            command.CommandTimeout = 0;

            AddParam(command, "@PickingDate", SqlDbType.VarChar, dme.PickingDate);

            AddParamForDataTable(command, "@Table", SqlDbType.Structured, dt);
            AddParam(command, "@Operator", SqlDbType.VarChar, dme.InsertOperator);
            AddParam(command, "@PC", SqlDbType.VarChar, dme.PC);

            //OUTパラメータの追加
            string outPutParam = "";

            UseTransaction = true;

            bool ret = InsertUpdateDeleteData(sp, ref outPutParam);

            if (ret)
            {
                dme.PickingNO = outPutParam;
            }

            return(ret);
        }
示例#3
0
        /// <summary>
        /// PickingList
        /// </summary>
        /// <param name="dpe"></param>
        /// <returns></returns>
        public DataTable PickingList_InsertUpdateSelect_Check3(D_Picking_Entity dpe)
        {
            string sp = "PickingList_InsertUpdateSelect_Check3";

            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@SoukoCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dpe.SoukoCD
                  } },
                { "@StoreCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dpe.StoreCD
                  } },
                { "@ShippingPlanDateFrom", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dpe.ShippingPlanDateFrom
                  } },
                { "@ShippingPlanDateTo", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dpe.ShippingPlanDateTo
                  } },
                { "@Operator", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dpe.Operator
                  } },
            };

            UseTransaction = true;
            return(SelectData(dic, sp));
        }
        private D_Picking_Entity GetSearchInfo()
        {
            dpe = new D_Picking_Entity
            {
                PrintDateTimeFrom = detailControls[(int)EIndex.DayStart].Text,
                PrintDateTimeTo   = detailControls[(int)EIndex.DayEnd].Text,
                SoukoCD           = CboSoukoCD.SelectedValue.ToString().Equals("-1") ? string.Empty : CboSoukoCD.SelectedValue.ToString(),
            };

            return(dpe);
        }
示例#5
0
        /// <summary>
        /// ピッキング番号検索
        /// </summary>
        /// <param name="de"></param>
        /// <returns></returns>
        public DataTable D_Picking_SelectAll(D_Picking_Entity de)
        {
            string sp = "D_Picking_SelectAll";

            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@PrintDateTimeFrom", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.PrintDateTimeFrom
                  } },
                { "@PrintDateTimeTo", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.PrintDateTimeTo
                  } },
                { "@SoukoCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.SoukoCD
                  } },
            };

            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)
            {
                pnbl.ShowMessage("E111");
                detailControls[0].Focus();
                return;
            }

            dpe = GetSearchInfo();
            DataTable dt = pnbl.D_Picking_SelectAll(dpe);

            GvDetail.DataSource = dt;

            if (dt.Rows.Count > 0)
            {
                GvDetail.SelectionMode       = DataGridViewSelectionMode.RowHeaderSelect;
                GvDetail.CurrentRow.Selected = true;
                GvDetail.Enabled             = true;
                GvDetail.Focus();
            }
            else
            {
                pnbl.ShowMessage("E128");
            }
        }
        protected override void PrintSec()
        {
            DataTable dtPrintData1 = new DataTable();
            DataTable dtPrintData2 = new DataTable();
            DataTable dtPrintData3 = new DataTable();
            DataTable dtPrintData4 = new DataTable();

            if (ErrorCheck())
            {
                if (chkUnissued1.Checked == true)
                {
                    dpe1 = new D_Picking_Entity
                    {
                        SoukoCD = cboSouko.SelectedValue.ToString(),
                        StoreCD = StoreCD,
                        ShippingPlanDateFrom = txtDateFrom1.Text,
                        ShippingPlanDateTo   = txtDateTo1.Text,
                        ShippingDate         = txtShipmentDate.Text,
                        InsertOperator       = InOperatorCD,
                        ProgramID            = this.InProgramID,
                        PC = InPcID,
                    };
                    dtPrintData1 = plbl.PickingList_InsertUpdateSelect_Check1(dpe1);
                }

                if (chkUnissued2.Checked == true)
                {
                    dpe2 = new D_Picking_Entity
                    {
                        SoukoCD        = cboSouko.SelectedValue.ToString(),
                        PickingNO      = ScPickingNo1.TxtCode.Text,
                        InsertOperator = InOperatorCD,
                    };
                    dtPrintData2 = plbl.PickingList_InsertUpdateSelect_Check2(dpe2);
                }

                if (chkReissued1.Checked == true)
                {
                    dpe3 = new D_Picking_Entity
                    {
                        SoukoCD = cboSouko.SelectedValue.ToString(),
                        StoreCD = StoreCD,
                        ShippingPlanDateFrom = txtDateFrom2.Text,
                        ShippingPlanDateTo   = txtDateTo2.Text,
                        InsertOperator       = InOperatorCD,
                    };
                    dtPrintData3 = plbl.PickingList_InsertUpdateSelect_Check3(dpe3);
                }

                if (chkReissued2.Checked == true)
                {
                    dpe4 = new D_Picking_Entity
                    {
                        SoukoCD        = cboSouko.SelectedValue.ToString(),
                        PickingNO      = ScPickingNo2.TxtCode.Text,
                        InsertOperator = InOperatorCD,
                    };
                    dtPrintData4 = plbl.PickingList_InsertUpdateSelect_Check2(dpe4);
                }


                // レコード定義を行う

                try
                {
                    if ((dtPrintData1 == null || dtPrintData1.Rows.Count <= 0) || (dtPrintData2 == null || dtPrintData2.Rows.Count <= 0) ||
                        (dtPrintData3 == null || dtPrintData3.Rows.Count <= 0) || (dtPrintData4 == null || dtPrintData4.Rows.Count <= 0))
                    {
                        bbl.ShowMessage("E128");
                    }
                    else
                    {
                        if (chkUnissued1.Checked == true && dtPrintData1.Rows.Count > 0)
                        {
                            DialogResult       ret;
                            PickingList_Report Report = new PickingList_Report();

                            switch (PrintMode)
                            {
                            case EPrintMode.DIRECT:

                                //Q208 印刷します。”はい”でプレビュー、”いいえ”で直接プリンターから印刷します。
                                ret = plbl.ShowMessage("Q208");
                                if (ret == DialogResult.Cancel)
                                {
                                    return;
                                }
                                Report.PrintOptions.PaperSize        = CrystalDecisions.Shared.PaperSize.PaperA4;
                                Report.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;

                                // 印字データをセット
                                Report.SetDataSource(dtPrintData1);
                                Report.Refresh();
                                Report.SetParameterValue("txtSouko", cboSouko.SelectedValue.ToString() + "  " + cboSouko.Text);
                                Report.SetParameterValue("pickingNO", dtPrintData1.Rows[0]["PickingNO"].ToString());

                                if (ret == DialogResult.Yes)
                                {
                                    //プレビュー
                                    var previewForm = new Viewer();
                                    previewForm.CrystalReportViewer1.ShowPrintButton = true;
                                    previewForm.CrystalReportViewer1.ReportSource    = Report;

                                    previewForm.ShowDialog();
                                }
                                else
                                {
                                    int marginLeft = 360;
                                    CrystalDecisions.Shared.PageMargins margin = Report.PrintOptions.PageMargins;
                                    margin.leftMargin   = marginLeft;   // mmの指定をtwip単位に変換する
                                    margin.topMargin    = marginLeft;
                                    margin.bottomMargin = marginLeft;   //mmToTwip(marginLeft);
                                    margin.rightMargin  = marginLeft;
                                    Report.PrintOptions.ApplyPageMargins(margin);
                                    // プリンタに印刷
                                    Report.PrintToPrinter(0, false, 0, 0);
                                }
                                break;

                            case EPrintMode.PDF:
                                if (plbl.ShowMessage("Q204") != DialogResult.Yes)
                                {
                                    return;
                                }
                                string filePath = "";
                                if (!ShowSaveFileDialog(InProgramNM, out filePath))
                                {
                                    return;
                                }

                                // 印字データをセット
                                Report.SetDataSource(dtPrintData1);
                                Report.Refresh();

                                bool result = OutputPDF(filePath, Report);

                                //PDF出力が完了しました。
                                plbl.ShowMessage("I202");

                                break;
                            }

                            plbl.D_Picking_Update(dtPrintData1.Rows[0]["PickingNO"].ToString(), InOperatorCD);
                        }

                        if (chkUnissued2.Checked == true && dtPrintData2.Rows.Count > 0)
                        {
                            DialogResult       ret;
                            PickingList_Report Report2 = new PickingList_Report();

                            switch (PrintMode)
                            {
                            case EPrintMode.DIRECT:



                                //Q208 印刷します。”はい”でプレビュー、”いいえ”で直接プリンターから印刷します。
                                ret = plbl.ShowMessage("Q208");
                                if (ret == DialogResult.Cancel)
                                {
                                    return;
                                }
                                Report2.PrintOptions.PaperSize        = CrystalDecisions.Shared.PaperSize.PaperA4;
                                Report2.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;

                                // 印字データをセット
                                Report2.SetDataSource(dtPrintData2);
                                Report2.Refresh();
                                Report2.SetParameterValue("txtSouko", cboSouko.SelectedValue.ToString() + "  " + cboSouko.Text);
                                Report2.SetParameterValue("pickingNO", dtPrintData2.Rows[0]["PickingNO"].ToString());

                                if (ret == DialogResult.Yes)
                                {
                                    //プレビュー
                                    var previewForm = new Viewer();
                                    previewForm.CrystalReportViewer1.ShowPrintButton = true;
                                    previewForm.CrystalReportViewer1.ReportSource    = Report2;
                                    //previewForm.CrystalReportViewer1.Zoom(1);

                                    previewForm.ShowDialog();
                                }
                                else
                                {
                                    int marginLeft = 360;
                                    CrystalDecisions.Shared.PageMargins margin = Report2.PrintOptions.PageMargins;
                                    margin.leftMargin   = marginLeft;   // mmの指定をtwip単位に変換する
                                    margin.topMargin    = marginLeft;
                                    margin.bottomMargin = marginLeft;   //mmToTwip(marginLeft);
                                    margin.rightMargin  = marginLeft;
                                    Report2.PrintOptions.ApplyPageMargins(margin);
                                    // プリンタに印刷
                                    Report2.PrintToPrinter(0, false, 0, 0);
                                }
                                break;

                            case EPrintMode.PDF:
                                if (plbl.ShowMessage("Q204") != DialogResult.Yes)
                                {
                                    return;
                                }
                                string filePath = "";
                                if (!ShowSaveFileDialog(InProgramNM, out filePath))
                                {
                                    return;
                                }

                                // 印字データをセット
                                Report2.SetDataSource(dtPrintData2);
                                Report2.Refresh();

                                bool result = OutputPDF(filePath, Report2);

                                //PDF出力が完了しました。
                                plbl.ShowMessage("I202");

                                break;
                            }

                            plbl.D_Picking_Update(dtPrintData2.Rows[0]["PickingNO"].ToString(), InOperatorCD);
                        }

                        if (chkReissued1.Checked == true && dtPrintData3.Rows.Count > 0)
                        {
                            DialogResult ret;
                            PickingList_Motori_Report Reportm = new PickingList_Motori_Report();

                            switch (PrintMode)
                            {
                            case EPrintMode.DIRECT:



                                //Q208 印刷します。”はい”でプレビュー、”いいえ”で直接プリンターから印刷します。
                                ret = plbl.ShowMessage("Q208");
                                if (ret == DialogResult.Cancel)
                                {
                                    return;
                                }
                                Reportm.PrintOptions.PaperSize        = CrystalDecisions.Shared.PaperSize.PaperA4;
                                Reportm.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;

                                // 印字データをセット
                                Reportm.SetDataSource(dtPrintData3);
                                Reportm.Refresh();
                                Reportm.SetParameterValue("txtSouko", cboSouko.SelectedValue.ToString() + "  " + cboSouko.Text);
                                Reportm.SetParameterValue("pickingNO", dtPrintData3.Rows[0]["PickingNO"].ToString());

                                if (ret == DialogResult.Yes)
                                {
                                    //プレビュー
                                    var previewForm = new Viewer();
                                    previewForm.CrystalReportViewer1.ShowPrintButton = true;
                                    previewForm.CrystalReportViewer1.ReportSource    = Reportm;

                                    previewForm.ShowDialog();
                                }
                                else
                                {
                                    int marginLeft = 360;
                                    CrystalDecisions.Shared.PageMargins margin = Reportm.PrintOptions.PageMargins;
                                    margin.leftMargin   = marginLeft;   // mmの指定をtwip単位に変換する
                                    margin.topMargin    = marginLeft;
                                    margin.bottomMargin = marginLeft;   //mmToTwip(marginLeft);
                                    margin.rightMargin  = marginLeft;
                                    Reportm.PrintOptions.ApplyPageMargins(margin);
                                    // プリンタに印刷
                                    Reportm.PrintToPrinter(0, false, 0, 0);
                                }
                                break;

                            case EPrintMode.PDF:
                                if (plbl.ShowMessage("Q204") != DialogResult.Yes)
                                {
                                    return;
                                }
                                string filePath = "";
                                if (!ShowSaveFileDialog(InProgramNM, out filePath))
                                {
                                    return;
                                }

                                // 印字データをセット
                                Reportm.SetDataSource(dtPrintData3);
                                Reportm.Refresh();

                                bool result = OutputPDF(filePath, Reportm);

                                //PDF出力が完了しました。
                                plbl.ShowMessage("I202");

                                break;
                            }


                            plbl.D_Picking_Update(dtPrintData3.Rows[0]["PickingNO"].ToString(), InOperatorCD);
                        }

                        if (chkReissued2.Checked == true && dtPrintData4.Rows.Count > 0)
                        {
                            DialogResult ret;
                            PickingList_Motori_Report Reportm2 = new PickingList_Motori_Report();

                            switch (PrintMode)
                            {
                            case EPrintMode.DIRECT:



                                //Q208 印刷します。”はい”でプレビュー、”いいえ”で直接プリンターから印刷します。
                                ret = plbl.ShowMessage("Q208");
                                if (ret == DialogResult.Cancel)
                                {
                                    return;
                                }
                                Reportm2.PrintOptions.PaperSize        = CrystalDecisions.Shared.PaperSize.PaperA4;
                                Reportm2.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;

                                // 印字データをセット
                                Reportm2.SetDataSource(dtPrintData4);
                                Reportm2.Refresh();
                                Reportm2.SetParameterValue("txtSouko", cboSouko.SelectedValue.ToString() + "  " + cboSouko.Text);
                                Reportm2.SetParameterValue("pickingNO", dtPrintData4.Rows[0]["PickingNO"].ToString());

                                if (ret == DialogResult.Yes)
                                {
                                    //プレビュー
                                    var previewForm = new Viewer();
                                    previewForm.CrystalReportViewer1.ShowPrintButton = true;
                                    previewForm.CrystalReportViewer1.ReportSource    = Reportm2;

                                    previewForm.ShowDialog();
                                }
                                else
                                {
                                    int marginLeft = 360;
                                    CrystalDecisions.Shared.PageMargins margin = Reportm2.PrintOptions.PageMargins;
                                    margin.leftMargin   = marginLeft;   // mmの指定をtwip単位に変換する
                                    margin.topMargin    = marginLeft;
                                    margin.bottomMargin = marginLeft;   //mmToTwip(marginLeft);
                                    margin.rightMargin  = marginLeft;
                                    Reportm2.PrintOptions.ApplyPageMargins(margin);
                                    // プリンタに印刷
                                    Reportm2.PrintToPrinter(0, false, 0, 0);
                                }
                                break;

                            case EPrintMode.PDF:
                                if (plbl.ShowMessage("Q204") != DialogResult.Yes)
                                {
                                    return;
                                }
                                string filePath = "";
                                if (!ShowSaveFileDialog(InProgramNM, out filePath))
                                {
                                    return;
                                }

                                // 印字データをセット
                                Reportm2.SetDataSource(dtPrintData4);
                                Reportm2.Refresh();

                                bool result = OutputPDF(filePath, Reportm2);

                                //PDF出力が完了しました。
                                plbl.ShowMessage("I202");

                                break;
                            }

                            plbl.D_Picking_Update(dtPrintData4.Rows[0]["PickingNO"].ToString(), InOperatorCD);
                        }
                    }
                }
                finally
                {
                }
            }
        }
示例#8
0
        /// <summary>
        /// ピッキング入力データ取得処理
        /// PickingNyuuryokuよりデータ抽出時に使用
        /// </summary>
        public DataTable D_Picking_SelectData(D_Picking_Entity de, short operationMode)
        {
            DataTable dt = ddl.D_Picking_SelectData(de, operationMode);

            return(dt);
        }
示例#9
0
 /// <summary>
 /// ピッキング入力更新処理(入荷から)
 /// PickingNyuuryokuより更新時に使用
 /// </summary>
 public bool Picking_Exec(D_Picking_Entity dme, DataTable dt, short operationMode)
 {
     return(ddl.D_Picking_Exec(dme, dt, operationMode));
 }
示例#10
0
 /// <summary>
 /// ピッキング番号検索
 /// </summary>
 /// <param name="de"></param>
 /// <returns></returns>
 public DataTable D_Picking_SelectAll(D_Picking_Entity de)
 {
     return(ddl.D_Picking_SelectAll(de));
 }
示例#11
0
 public DataTable PickingList_InsertUpdateSelect_Check3(D_Picking_Entity dpe)
 {
     return(dpdl.PickingList_InsertUpdateSelect_Check3(dpe));
 }