Exemplo n.º 1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.Order.Tb_Order_RegistWare model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@RegistWareID",           SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@ReleaseID",              SqlDbType.BigInt,            8),
                new SqlParameter("@Count",                  SqlDbType.Float,             8),
                new SqlParameter("@RegistID",               SqlDbType.VarChar,          36),
                new SqlParameter("@IsDelete",               SqlDbType.SmallInt,          2),
                new SqlParameter("@ResourcesSalePrice",     SqlDbType.Float,             8),
                new SqlParameter("@ResourcesDisCountPrice", SqlDbType.Float,             8),
                new SqlParameter("@GroupBuyPrice",          SqlDbType.Float, 8)
            };
            parameters[0].Value = model.RegistWareID;
            parameters[1].Value = model.ReleaseID;
            parameters[2].Value = model.Count;
            parameters[3].Value = model.RegistID;
            parameters[4].Value = model.IsDelete;
            parameters[5].Value = model.ResourcesSalePrice;
            parameters[6].Value = model.ResourcesDisCountPrice;
            parameters[7].Value = model.GroupBuyPrice;

            DbHelperSQL.RunProcedure("Proc_Tb_Order_RegistWare_Update", parameters, out rowsAffected);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.Order.Tb_Order_RegistWare GetModel(Guid RegistWareID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@RegistWareID", SqlDbType.UniqueIdentifier)
            };
            parameters[0].Value = RegistWareID;

            MobileSoft.Model.Order.Tb_Order_RegistWare model = new MobileSoft.Model.Order.Tb_Order_RegistWare();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Order_RegistWare_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["RegistWareID"].ToString() != "")
                {
                    model.RegistWareID = new Guid(ds.Tables[0].Rows[0]["RegistWareID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ReleaseID"].ToString() != "")
                {
                    model.ReleaseID = long.Parse(ds.Tables[0].Rows[0]["ReleaseID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Count"].ToString() != "")
                {
                    model.Count = decimal.Parse(ds.Tables[0].Rows[0]["Count"].ToString());
                }
                model.RegistID = ds.Tables[0].Rows[0]["RegistID"].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]["ResourcesSalePrice"].ToString() != "")
                {
                    model.ResourcesSalePrice = decimal.Parse(ds.Tables[0].Rows[0]["ResourcesSalePrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ResourcesDisCountPrice"].ToString() != "")
                {
                    model.ResourcesDisCountPrice = decimal.Parse(ds.Tables[0].Rows[0]["ResourcesDisCountPrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["GroupBuyPrice"].ToString() != "")
                {
                    model.GroupBuyPrice = decimal.Parse(ds.Tables[0].Rows[0]["GroupBuyPrice"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }