Esempio n. 1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.Information.Tb_Information_BussPromotion model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@ProID",       SqlDbType.BigInt,      8),
                new SqlParameter("@BussId",      SqlDbType.BigInt,      8),
                new SqlParameter("@Project",     SqlDbType.NVarChar,  100),
                new SqlParameter("@Publisher",   SqlDbType.NVarChar,  100),
                new SqlParameter("@PublishDate", SqlDbType.DateTime),
                new SqlParameter("@Reason",      SqlDbType.NVarChar,  500),
                new SqlParameter("@ProImage",    SqlDbType.NVarChar,  100),
                new SqlParameter("@IsDelete",    SqlDbType.SmallInt,    2),
                new SqlParameter("@NumID",       SqlDbType.BigInt, 8)
            };
            parameters[0].Value = model.ProID;
            parameters[1].Value = model.BussId;
            parameters[2].Value = model.Project;
            parameters[3].Value = model.Publisher;
            parameters[4].Value = model.PublishDate;
            parameters[5].Value = model.Reason;
            parameters[6].Value = model.ProImage;
            parameters[7].Value = model.IsDelete;
            parameters[8].Value = model.NumID;

            DbHelperSQL.RunProcedure("Proc_Tb_Information_BussPromotion_Update", parameters, out rowsAffected);
        }
Esempio n. 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.Information.Tb_Information_BussPromotion GetModel(long ProID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@ProID", SqlDbType.BigInt)
            };
            parameters[0].Value = ProID;

            MobileSoft.Model.Information.Tb_Information_BussPromotion model = new MobileSoft.Model.Information.Tb_Information_BussPromotion();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Information_BussPromotion_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ProID"].ToString() != "")
                {
                    model.ProID = long.Parse(ds.Tables[0].Rows[0]["ProID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BussId"].ToString() != "")
                {
                    model.BussId = long.Parse(ds.Tables[0].Rows[0]["BussId"].ToString());
                }
                model.Project   = ds.Tables[0].Rows[0]["Project"].ToString();
                model.Publisher = ds.Tables[0].Rows[0]["Publisher"].ToString();
                if (ds.Tables[0].Rows[0]["PublishDate"].ToString() != "")
                {
                    model.PublishDate = DateTime.Parse(ds.Tables[0].Rows[0]["PublishDate"].ToString());
                }
                model.Reason   = ds.Tables[0].Rows[0]["Reason"].ToString();
                model.ProImage = ds.Tables[0].Rows[0]["ProImage"].ToString();
                if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "")
                {
                    model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NumID"].ToString() != "")
                {
                    model.NumID = long.Parse(ds.Tables[0].Rows[0]["NumID"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }