Beispiel #1
0
        public void UpdateWare_Bill_Transfer(int lgIndex, SqlCommand cmd, MWare_Bill_Transfer model)
        {
            StringBuilder strSql = new StringBuilder();

            SqlParameter[] parameters;
            /////////////////修改,撤销预扣//////////////////////////////
            strSql.Append("SP_Ware_Bill_Transfer_EditVerify");
            parameters = new SqlParameter[] {
                new SqlParameter("@LgIndex", SqlDbType.Int),
                new SqlParameter("@PKCode", SqlDbType.VarChar, 25)
            };
            parameters[0].Value = lgIndex;
            parameters[1].Value = model.ID;
            cmd.ExecuteMySPQuery(strSql.ToString(), parameters);
            /////////////////////////////////////////////////////////////////
            strSql.Clear();
            strSql.Append("update Ware_Bill_Transfer set ");
            strSql.Append("WhCodeOut=@WhCodeOut,");
            strSql.Append("WhCodeIn=@WhCodeIn,");
            strSql.Append("Remark=@Remark");
            strSql.Append(" where ID=@ID ");
            parameters = new SqlParameter[] {
                new SqlParameter("@WhCodeOut", SqlDbType.VarChar, 10),
                new SqlParameter("@WhCodeIn", SqlDbType.VarChar, 10),
                new SqlParameter("@Remark", SqlDbType.NVarChar, 200),
                new SqlParameter("@ID", SqlDbType.VarChar, 25)
            };
            parameters[0].Value = model.WhCodeOut;
            parameters[1].Value = model.WhCodeIn;
            parameters[2].Value = model.Remark;
            parameters[3].Value = model.ID;
            cmd.ExecuteMyQuery(strSql.ToString(), parameters);
        }
Beispiel #2
0
        private void PrepareExtend(MWare_Bill_Transfer model)
        {
            model.Sub_Extend = new MWare_Bill_Extend()
            {
                ID        = model.ID,
                SPHL      = 0,
                SPHR      = 0,
                CYLL      = 0,
                CYLR      = 0,
                X_ADDL    = 0,
                X_ADDR    = 0,
                LensCodeL = "",
                LensCodeR = "",
                SCode     = "",
                SumQty    = 0,
            };

            switch (model.MType)
            {
            case "L":

                model.Sub_Extend.LensCodeR = model.Sub_PD.LensCode;
                model.Sub_Extend.LensCodeL = model.Sub_PD.LensCode;
                model.Sub_Extend.SumQty    = model.Sub_PD_Detail.Sum(it => it.Qty);
                break;

            default:

                break;
            }
        }
Beispiel #3
0
        public void AddWare_Bill_Transfer(int lgIndex, SqlCommand cmd, MWare_Bill_Transfer model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Ware_Bill_Transfer(");
            strSql.Append("ID,BCode,BDate,BType,MType,StCode,WhCodeIn,WhCodeOut,Remark,Maker,MName,MDate,F_Chk,CheckerIn,ChNameIn,ChDateIn,CheckerOut,ChNameOut,ChDateOut,F_Del,Deler,DelName,DelDate)");
            strSql.Append(" values (");
            strSql.Append("@ID,@BCode,@BDate,@BType,@MType,@StCode,@WhCodeIn,@WhCodeOut,@Remark,@Maker,@MName,@MDate,@F_Chk,@CheckerIn,@ChNameIn,@ChDateIn,@CheckerOut,@ChNameOut,@ChDateOut,@F_Del,@Deler,@DelName,@DelDate)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",         SqlDbType.VarChar,    25),
                new SqlParameter("@BCode",      SqlDbType.VarChar,    30),
                new SqlParameter("@BDate",      SqlDbType.Date,        3),
                new SqlParameter("@BType",      SqlDbType.VarChar,    10),
                new SqlParameter("@MType",      SqlDbType.VarChar,    10),
                new SqlParameter("@StCode",     SqlDbType.VarChar,    10),
                new SqlParameter("@WhCodeIn",   SqlDbType.VarChar,    10),
                new SqlParameter("@WhCodeOut",  SqlDbType.VarChar,    10),
                new SqlParameter("@Remark",     SqlDbType.NVarChar,  200),
                new SqlParameter("@Maker",      SqlDbType.VarChar,    10),
                new SqlParameter("@MName",      SqlDbType.NVarChar,   30),
                new SqlParameter("@MDate",      SqlDbType.DateTime),
                new SqlParameter("@F_Chk",      SqlDbType.Bit,         1),
                new SqlParameter("@CheckerIn",  SqlDbType.VarChar,    10),
                new SqlParameter("@ChNameIn",   SqlDbType.NVarChar,   30),
                new SqlParameter("@ChDateIn",   SqlDbType.DateTime),
                new SqlParameter("@CheckerOut", SqlDbType.VarChar,    10),
                new SqlParameter("@ChNameOut",  SqlDbType.NVarChar,   30),
                new SqlParameter("@ChDateOut",  SqlDbType.DateTime),
                new SqlParameter("@F_Del",      SqlDbType.Bit,         1),
                new SqlParameter("@Deler",      SqlDbType.VarChar,    10),
                new SqlParameter("@DelName",    SqlDbType.NVarChar,   30),
                new SqlParameter("@DelDate",    SqlDbType.DateTime)
            };
            parameters[0].Value  = model.ID;
            parameters[1].Value  = model.BCode;
            parameters[2].Value  = model.BDate;
            parameters[3].Value  = model.BType;
            parameters[4].Value  = model.MType;
            parameters[5].Value  = model.StCode;
            parameters[6].Value  = model.WhCodeIn;
            parameters[7].Value  = model.WhCodeOut;
            parameters[8].Value  = model.Remark;
            parameters[9].Value  = model.Maker;
            parameters[10].Value = model.MName;
            parameters[11].Value = System.DateTime.Now; //model.MDate;
            parameters[12].Value = false;               //model.F_Chk;
            parameters[13].Value = "";                  //model.CheckerIn;
            parameters[14].Value = "";                  //model.ChNameIn;
            parameters[15].Value = System.DBNull.Value; //model.ChDateIn;
            parameters[16].Value = "";                  //model.CheckerOut;
            parameters[17].Value = "";                  //model.ChNameOut;
            parameters[18].Value = System.DBNull.Value; //model.ChDateOut;
            parameters[19].Value = false;               //model.F_Del;
            parameters[20].Value = "";                  //model.Deler;
            parameters[21].Value = "";                  // model.DelName;
            parameters[22].Value = System.DBNull.Value; //model.DelDate;
            cmd.ExecuteMyQuery(strSql.ToString(), parameters);
        }
Beispiel #4
0
        private void PreparePD(int lgIndex, SqlCommand cmd, MWare_Bill_Transfer model)
        {
            model.Sub_PD.ID = model.ID;
            _DW.AddWare_Bill_PD(lgIndex, cmd, model.Sub_PD);

            model.Sub_PD_Detail.ForEach(it => it.ID = model.ID);
            _DW.AddWare_Bill_PD_Detail(lgIndex, cmd, model.Sub_PD_Detail);
        }
Beispiel #5
0
        protected override void PrepareAddSub(int lgIndex, SqlCommand cmd, object t)
        {
            MWare_Bill_Transfer model = t as MWare_Bill_Transfer;

            switch (model.MType)
            {
            case "L":
                this.PreparePD(lgIndex, cmd, model);
                break;

            default:
                break;
            }
            this.PrepareAddExtend(lgIndex, cmd, model);
        }
Beispiel #6
0
        public void UpdateEditWare_Bill_Transfer(int lgIndex, SqlCommand cmd, MWare_Bill_Transfer model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Ware_Bill_Transfer set ");
            strSql.Append("Remark=@Remark");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Remark", SqlDbType.NVarChar, 200),
                new SqlParameter("@ID",     SqlDbType.VarChar, 25)
            };
            parameters[0].Value = model.Remark;
            parameters[1].Value = model.ID;
            cmd.ExecuteMyQuery(strSql.ToString(), parameters);
        }
Beispiel #7
0
 private void PrepareAddExtend(int lgIndex, SqlCommand cmd, MWare_Bill_Transfer model)
 {
     this.PrepareExtend(model);
     _DW.AddWare_Bill_Extend(lgIndex, cmd, model.Sub_Extend);
 }
Beispiel #8
0
        protected override void PrepareAddMain(int lgIndex, SqlCommand cmd, object t)
        {
            MWare_Bill_Transfer model = t as MWare_Bill_Transfer;

            _DW.AddWare_Bill_Transfer(lgIndex, cmd, model);
        }
Beispiel #9
0
 private void UpdatePD(int lgIndex, SqlCommand cmd, MWare_Bill_Transfer model)
 {
     _DW.UpdateWare_Bill_PD(lgIndex, cmd, model.Sub_PD);
     _DW.UpdateWare_Bill_PD_Detail(lgIndex, cmd, model.Sub_PD_Detail);
 }
Beispiel #10
0
 public void UpdateEdit(string dbCode, int lgIndex, MWare_Bill_Transfer t)
 {
     bllUpdateEdit.UpdateEdit(dbCode, lgIndex, t);
 }
Beispiel #11
0
 public string Add(string dbCode, int lgIndex, MWare_Bill_Transfer t)
 {
     return(bll.Add(dbCode, lgIndex, t));
 }