/// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(CdHotelManage.Model.AccountsUserRoles model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Accounts_UserRoles(");
            strSql.Append("UserID,RoleID)");
            strSql.Append(" values (");
            strSql.Append("@UserID,@RoleID)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserID", SqlDbType.VarChar, 50),
                new SqlParameter("@RoleID", SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UserID;
            parameters[1].Value = model.RoleID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CdHotelManage.Model.AccountsUserRoles model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Accounts_UserRoles set ");
            strSql.Append("RoleID=@RoleID");
            strSql.Append(" where UserID=@UserID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserID", SqlDbType.VarChar, 50),
                new SqlParameter("@RoleID", SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UserID;
            parameters[1].Value = model.RoleID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CdHotelManage.Model.AccountsUserRoles GetModel(string uid)
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 UserID,RoleID from Accounts_UserRoles ");
            strSql.Append(" where UserID=@UserID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserID", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = uid;
            CdHotelManage.Model.AccountsUserRoles model = new CdHotelManage.Model.AccountsUserRoles();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["UserID"] != null && ds.Tables[0].Rows[0]["UserID"].ToString() != "")
                {
                    model.UserID = ds.Tables[0].Rows[0]["UserID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["RoleID"] != null && ds.Tables[0].Rows[0]["RoleID"].ToString() != "")
                {
                    model.RoleID = ds.Tables[0].Rows[0]["RoleID"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CdHotelManage.Model.AccountsUserRoles model)
 {
     return AccountRolesBridge.Update(model);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(CdHotelManage.Model.AccountsUserRoles model)
 {
     return AccountRolesBridge.Add(model);
 }