示例#1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.HSPR.Tb_HSPR_CommFriend GetModel(string FriendCode)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@FriendCode", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = FriendCode;

            MobileSoft.Model.HSPR.Tb_HSPR_CommFriend model = new MobileSoft.Model.HSPR.Tb_HSPR_CommFriend();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CommFriend_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.FriendCode   = ds.Tables[0].Rows[0]["FriendCode"].ToString();
                model.CustId       = ds.Tables[0].Rows[0]["CustId"].ToString();
                model.FriendCustId = ds.Tables[0].Rows[0]["FriendCustId"].ToString();
                model.RoomSign     = ds.Tables[0].Rows[0]["RoomSign"].ToString();
                if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "")
                {
                    model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.HSPR.Tb_HSPR_CommFriend model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@FriendCode",   SqlDbType.VarChar, 36),
                new SqlParameter("@CustId",       SqlDbType.VarChar, 36),
                new SqlParameter("@FriendCustId", SqlDbType.VarChar, 36),
                new SqlParameter("@RoomSign",     SqlDbType.VarChar, 36),
                new SqlParameter("@IsDelete",     SqlDbType.Int, 4)
            };
            parameters[0].Value = model.FriendCode;
            parameters[1].Value = model.CustId;
            parameters[2].Value = model.FriendCustId;
            parameters[3].Value = model.RoomSign;
            parameters[4].Value = model.IsDelete;

            DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CommFriend_Update", parameters, out rowsAffected);
        }