private bool SelectAndInsertExclusive(string mitsumoriNo)
        {
            //DeleteExclusive();

            //排他Tableに該当番号が存在するとError
            //[D_Exclusive]
            Exclusive_BL       ebl = new Exclusive_BL();
            D_Exclusive_Entity dee = new D_Exclusive_Entity
            {
                DataKBN  = (int)Exclusive_BL.DataKbn.Mitsumori,
                Number   = mitsumoriNo,
                Program  = this.InProgramID,
                Operator = this.InOperatorCD,
                PC       = this.InPcID
            };

            DataTable dt = ebl.D_Exclusive_Select(dee);

            if (dt.Rows.Count > 0)
            {
                bbl.ShowMessage("S004", dt.Rows[0]["Program"].ToString(), dt.Rows[0]["Operator"].ToString());
                //detailControls[(int)EIndex.MitsumoriNO].Focus();
                return(false);
            }
            else
            {
                bool ret = ebl.D_Exclusive_Insert(dee);
                mOldMitsumoriNo = mitsumoriNo;
                return(ret);
            }
        }
        public bool D_Exclusive_Insert(D_Exclusive_Entity dee)
        {
            string sp = "D_Exclusive_Insert";

            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@DataKBN", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = dee.DataKBN.ToString()
                  } },
                { "@Number", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dee.Number
                  } },
                { "@Operator", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dee.Operator
                  } },
                { "@Program", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dee.Program
                  } },
                { "@PC", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dee.PC
                  } },
            };

            UseTransaction = true;
            return(InsertUpdateDeleteData(dic, sp));
        }
        /// <summary>
        /// </summary>
        /// <param name="dme"></param>
        /// <param name="operationMode"></param>
        /// <param name="operatorNm"></param>
        /// <param name="pc"></param>
        /// <returns></returns>
        public bool D_Exclusive_Exec(D_Exclusive_Entity dme, DataTable dt, short operationMode, string operatorNm, string pc)
        {
            string sp = "PRC_MitsumoriNyuuryoku";

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

            command.Parameters.Add("@OperateMode", SqlDbType.TinyInt).Value = operationMode;
            //command.Parameters.Add("@GeneralRate", SqlDbType.Decimal).Value = dme.GeneralRate;
            //command.Parameters.Add("@MemberRate", SqlDbType.Decimal).Value = dme.MemberRate;
            //command.Parameters.Add("@ClientRate", SqlDbType.Decimal).Value = dme.ClientRate;
            //command.Parameters.Add("@SaleRate", SqlDbType.Decimal).Value = dme.SaleRate;
            //command.Parameters.Add("@WebRate", SqlDbType.Decimal).Value = dme.WebRate;
            command.Parameters.Add("@Table", SqlDbType.Structured).Value = dt;

            command.Parameters.Add("@DeleteFlg", SqlDbType.TinyInt).Value = dme.DeleteFlg;
            command.Parameters.Add("@UsedFlg", SqlDbType.TinyInt).Value   = dme.UsedFlg;
            command.Parameters.Add("@Operator", SqlDbType.VarChar).Value  = operatorNm;
            command.Parameters.Add("@PC", SqlDbType.VarChar).Value        = pc;

            string outPutParam = "";

            UseTransaction = true;
            return(InsertUpdateDeleteData(sp, ref outPutParam));
        }
        /// <summary>
        /// 排他処理データを削除する
        /// </summary>
        private void DeleteExclusive(DataTable dtForUpdate = null)
        {
            if (mOldInstructionNO == "" && dtForUpdate == null)
            {
                return;
            }

            Exclusive_BL ebl = new Exclusive_BL();

            if (dtForUpdate != null)
            {
                foreach (DataRow dr in dtForUpdate.Rows)
                {
                    D_Exclusive_Entity de = new D_Exclusive_Entity();
                    de.DataKBN = (int)Exclusive_BL.DataKbn.SyukkaShiji;
                    de.Number  = dr["no"].ToString();

                    ebl.D_Exclusive_Delete(de);
                }
                return;
            }

            D_Exclusive_Entity dee = new D_Exclusive_Entity
            {
                DataKBN = (int)Exclusive_BL.DataKbn.Mitsumori,
                Number  = mOldInstructionNO,
            };

            bool ret = ebl.D_Exclusive_Delete(dee);

            mOldInstructionNO = "";
        }
        private bool SelectAndInsertExclusive(string InstructionNO)
        {
            DeleteExclusive();

            //排他Tableに該当番号が存在するとError
            //[D_Exclusive]
            Exclusive_BL       ebl = new Exclusive_BL();
            D_Exclusive_Entity dee = new D_Exclusive_Entity
            {
                DataKBN  = (int)Exclusive_BL.DataKbn.SyukkaShiji,
                Number   = InstructionNO,
                Program  = this.InProgramID,
                Operator = this.InOperatorCD,
                PC       = this.InPcID
            };

            DataTable dt = ebl.D_Exclusive_Select(dee);

            if (dt.Rows.Count > 0)
            {
                bbl.ShowMessage("S004", dt.Rows[0]["Program"].ToString(), dt.Rows[0]["Operator"].ToString());
                return(false);
            }
            else
            {
                bool ret = ebl.D_Exclusive_Insert(dee);
                mOldInstructionNO = InstructionNO;
                return(ret);
            }
        }
        /// <summary>
        /// 排他処理データを削除する
        /// </summary>
        private void DeleteExclusive(DataTable dtForUpdate = null)
        {
            if (mOldBillingNo == "" && dtForUpdate == null)
            {
                return;
            }

            Exclusive_BL ebl = new Exclusive_BL();

            if (dtForUpdate != null)
            {
                foreach (DataRow dr in dtForUpdate.Rows)
                {
                    D_Exclusive_Entity de = new D_Exclusive_Entity();
                    de.DataKBN = (int)Exclusive_BL.DataKbn.Seikyu;
                    de.Number  = dr["no"].ToString();

                    ebl.D_Exclusive_Delete(de);
                }
                return;
            }

            D_Exclusive_Entity dee = new D_Exclusive_Entity
            {
                DataKBN = (int)Exclusive_BL.DataKbn.Seikyu,
                Number  = mOldBillingNo,
            };

            bool ret = ebl.D_Exclusive_Delete(dee);

            mOldBillingNo = "";
        }
        /// <summary>
        /// </summary>
        public DataTable D_Exclusive_SelectData(D_Exclusive_Entity mie, short operationMode)
        {
            string sp = "D_Exclusive_SelectData";

            //command.Parameters.Add("@SyoKBN", SqlDbType.TinyInt).Value = mie.SyoKBN;
            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@OperateMode", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = operationMode.ToString()
                  } },
                //{ "@MitsumoriNO", new ValuePair { value1 = SqlDbType.VarChar, value2 = mie.MitsumoriNO } },
            };

            return(SelectData(dic, sp));
        }
        public DataTable D_Exclusive_Select(D_Exclusive_Entity dee)
        {
            string sp = "D_Exclusive_Select";

            Dictionary <string, ValuePair> dic = new Dictionary <string, ValuePair>
            {
                { "@DataKBN", new ValuePair {
                      value1 = SqlDbType.TinyInt, value2 = dee.DataKBN.ToString()
                  } },
                { "@Number", new ValuePair {
                      value1 = SqlDbType.VarChar, value2 = dee.Number
                  } },
            };

            return(SelectData(dic, sp));
        }
        /// <summary>
        /// 排他処理データを削除する
        /// </summary>
        private void DeleteExclusive(DataTable dtForUpdate = null)
        {
            if (dtForUpdate == null)
            {
                return;
            }

            Exclusive_BL ebl = new Exclusive_BL();

            if (dtForUpdate != null)
            {
                foreach (DataRow dr in dtForUpdate.Rows)
                {
                    D_Exclusive_Entity de = new D_Exclusive_Entity();
                    de.DataKBN = (int)Exclusive_BL.DataKbn.Shiire;
                    de.Number  = dr["no"].ToString();

                    ebl.D_Exclusive_Delete(de);
                }
                return;
            }
        }
Example #10
0
 public bool D_Exclusive_Delete(D_Exclusive_Entity dee)
 {
     return(mdl.D_Exclusive_Delete(dee));
 }
Example #11
0
 public bool D_Exclusive_Insert(D_Exclusive_Entity dee)
 {
     return(mdl.D_Exclusive_Insert(dee));
 }
Example #12
0
        public DataTable D_Exclusive_Select(D_Exclusive_Entity dee)
        {
            DataTable dt = mdl.D_Exclusive_Select(dee);

            return(dt);
        }