Exemplo n.º 1
0
        /// <summary>
        /// 棚卸差異表,棚卸表データ取得処理
        /// </summary>
        /// <param name="de"></param>
        /// <returns></returns>
        public DataTable D_Inventory_SelectForPrint(D_Inventory_Entity de)
        {
            string sp = "D_Inventory_SelectForPrint";

            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@InventoryDate", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.InventoryDate
                  } },
                { "@SoukoCD", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = de.SoukoCD
                  } },
                { "@ChkSaiOnly", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = de.ChkSaiOnly.ToString()
                  } },
                { "@KbnSai", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = de.KbnSai.ToString()
                  } },
                { "@ChkKinyu", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = de.ChkKinyu.ToString()
                  } },
            };

            return(SelectData(dic, sp));
        }
        /// <summary>
        /// 棚卸表データ取得処理
        /// </summary>
        /// <param name="set">画面展開なしの場合:falesに設定する</param>
        /// <returns></returns>
        private DataTable CheckData()
        {
            for (int i = 0; i < detailControls.Length; i++)
            {
                if (CheckDetail(i, false) == false)
                {
                    detailControls[i].Focus();
                    return(null);
                }
            }

            //[D_Inventory_SelectForPrint]
            die = GetSearchInfo();

            DataTable dt = tabl.D_Inventory_SelectForPrint(die);

            //以下の条件でデータが存在しなければエラー (Error if record does not exist)E133
            if (dt.Rows.Count == 0)
            {
                bbl.ShowMessage("E133");
                previousCtrl.Focus();
                return(null);
            }

            return(dt);
        }
        /// <summary>
        /// 画面情報をセット
        /// </summary>
        /// <returns></returns>
        private D_Inventory_Entity GetEntity()
        {
            doe               = new D_Inventory_Entity();
            doe.SoukoCD       = CboSoukoCD.SelectedValue.ToString();
            doe.InventoryDate = detailControls[(int)EIndex.InventoryDate].Text;

            return(doe);
        }
        /// <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);
                }
            }

            //[D_Inventory_SelectForPrint]
            die = GetEntity();

            DataTable dt = tabl.D_Inventory_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 (row["DisplayRows"].ToString() == "1" )
            //        {
            //            bool ret = SelectAndInsertExclusive(row["PurchaseNO"].ToString());
            //            if (!ret)
            //                return null;

            //            i++;
            //            // データを追加
            //            DataRow rowForUpdate;
            //            rowForUpdate = dtForUpdate.NewRow();
            //            rowForUpdate["no"] = row["PurchaseNO"].ToString();
            //            dtForUpdate.Rows.Add(rowForUpdate);
            //        }
            //    }
            //}
            return(dt);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 棚卸入力データ取得処理
        /// </summary>
        /// <param name="doe"></param>
        /// <returns></returns>
        public DataTable D_Inventory_SelectAll(D_Inventory_Entity de)
        {
            string sp = "D_Inventory_SelectAll";

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

            return(SelectData(dic, sp));
        }
        protected override void ExecDisp()
        {
            for (int i = 0; i < detailControls.Length; i++)
            {
                if (CheckDetail(i) == false)
                {
                    detailControls[i].Focus();
                    return;
                }
            }

            //更新処理
            doe = GetEntity();
            DataTable dt = tabl.D_Inventory_SelectAll(doe);

            GvDetail.DataSource = dt;

            if (dt.Rows.Count > 0)
            {
                GvDetail.SelectionMode       = DataGridViewSelectionMode.CellSelect;
                GvDetail.CurrentRow.Selected = true;
                GvDetail.Enabled             = true;
                GvDetail.Focus();
                GvDetail.CurrentCell = GvDetail[(int)EColNo.ActualQuantity, 0];
                GvDetail.ReadOnly    = false;
                for (int i = 0; i < (int)EColNo.COUNT; i++)
                {
                    if (i == (int)EColNo.ActualQuantity)
                    {
                        GvDetail.Columns[i].ReadOnly = false;
                    }
                    else
                    {
                        GvDetail.Columns[i].ReadOnly = true;
                    }
                }
            }
            else
            {
                bbl.ShowMessage("E128");
            }
        }
        private D_Inventory_Entity GetEntity()
        {
            die = new D_Inventory_Entity
            {
                InventoryDate = detailControls[(int)EIndex.InventoryDate].Text,
                SoukoCD       = CboSoukoCD.SelectedValue.ToString(),
            };

            if (ckM_RadioButton1.Checked)
            {
                die.ChkSaiOnly = 1;
            }
            else
            {
                die.ChkSaiOnly = 0;
            }

            die.KbnSai         = 1;
            die.InsertOperator = InOperatorCD;
            die.PC             = InPcID;

            return(die);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 棚卸入力更新処理
        /// TanaoroshiNyuuryokuより更新時に使用
        /// </summary>
        /// <param name="dme"></param>
        /// <param name="operationMode"></param>
        /// <param name="operatorNm"></param>
        /// <param name="pc"></param>
        /// <returns></returns>
        public bool D_Inventory_Update(D_Inventory_Entity de, DataTable dt)
        {
            string sp = "D_Inventory_Update";

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

            AddParam(command, "@SoukoCD", SqlDbType.VarChar, de.SoukoCD);
            AddParam(command, "@InventoryDate", SqlDbType.VarChar, de.InventoryDate);

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

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

            UseTransaction = true;

            bool ret = InsertUpdateDeleteData(sp, ref outPutParam);

            return(ret);
        }
 /// <summary>
 /// 棚卸入力にて更新時に使用
 /// </summary>
 /// <param name="de"></param>
 /// <param name="dt"></param>
 /// <returns></returns>
 public bool D_Inventory_Update(D_Inventory_Entity de, DataTable dt)
 {
     return(mdl.D_Inventory_Update(de, dt));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 棚卸入力にて使用
 /// </summary>
 /// <param name="de"></param>
 /// <returns></returns>
 public DataTable D_Inventory_SelectAll(D_Inventory_Entity de)
 {
     return(mdl.D_Inventory_SelectAll(de));
 }
Exemplo n.º 11
0
 /// <summary>
 /// 棚卸差異表データ取得処理
 /// </summary>
 /// <param name="de"></param>
 /// <returns></returns>
 public DataTable D_Inventory_SelectForPrint(D_Inventory_Entity de)
 {
     return(mdl.D_Inventory_SelectForPrint(de));
 }