/// <summary> /// 更新一条数据 /// </summary> public bool Update(CdHotelManage.Model.AccountsRoles model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Accounts_Roles set "); strSql.Append("title=@title, "); strSql.Append("Description=@Description"); strSql.Append(" where RoleID=@RoleID"); SqlParameter[] parameters = { new SqlParameter("@RoleID", SqlDbType.Int, 4), new SqlParameter("@title", SqlDbType.NVarChar, 100), new SqlParameter("@Description", SqlDbType.NVarChar, 500) }; parameters[0].Value = model.RoleID; parameters[1].Value = model.Title; parameters[2].Value = model.Description; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(CdHotelManage.Model.AccountsRoles model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Accounts_Roles("); strSql.Append("RoleID,title,Description)"); strSql.Append(" values ("); strSql.Append("@RoleID,@title,@Description)"); SqlParameter[] parameters = { new SqlParameter("@RoleID", SqlDbType.Int, 4), new SqlParameter("@title", SqlDbType.NVarChar, 100), new SqlParameter("@Description", SqlDbType.NVarChar, 255) }; parameters[0].Value = model.RoleID; parameters[1].Value = model.Title; parameters[2].Value = model.Description; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(CdHotelManage.Model.AccountsRoles model) { return(RolesBridge.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(CdHotelManage.Model.AccountsRoles model) { return(RolesBridge.Add(model)); }