/// <summary> /// 向数据表DawnAuthRole修改一条记录 /// </summary> /// <param name="dawnAuthRole">DawnAuthRole实体对象</param> /// <returns></returns> public static int Update(DawnAuthRoleMDL dawnAuthRole) { if (dawnAuthRole == null) { return(0); } return(DawnAuthRoleBLL._dal.Update(dawnAuthRole)); }
/// <summary> /// 向数据表DawnAuthRole中插入一条新记录 /// </summary> /// <param name="dawnAuthRole">DawnAuthRole实体对象</param> /// <returns></returns> public static int Insert(DawnAuthRoleMDL dawnAuthRole) { if (dawnAuthRole == null) { return(0); } return(DawnAuthRoleBLL._dal.Insert(dawnAuthRole)); }
/// <summary> /// 向数据表DawnAuthRole中插入一条新记录。带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthRole">DawnAuthRole实体对象</param> /// <returns>ı</returns> public static int Insert(SqlTransaction sp, DawnAuthRoleMDL dawnAuthRole) { if (dawnAuthRole == null) { return(0); } return(DawnAuthRoleBLL._dal.Insert(sp, dawnAuthRole)); }
public string Editored(FormCollection form) { if (TypeHelper.TypeToInt32(form["hidRoleId"], -1) < 0) { return(GeneralHandler.FBaseInfo); } var stateInfo = GeneralHandler.StateSuccess; if (EditoredByCheck(form, out stateInfo)) { DawnAuthRoleMDL dataInfo = new DawnAuthRoleMDL(); dataInfo.RoleId = int.Parse(form["hidRoleId"]); dataInfo.RoleName = form["txtName"]; dataInfo.RoleDesc = form["txtDesc"]; DawnAuthRoleBLL.UpdateEditor(dataInfo); } return(stateInfo); }
/// <summary> /// 向数据表DawnAuthRole修改一条记录 /// </summary> /// <param name="dawnAuthRole">dawnAuthRole实体对象</param> /// <returns></returns> public int UpdateEditor(DawnAuthRoleMDL dawnAuthRole) { StringBuilder sb = new StringBuilder(); sb.Append("update dawn_auth_role set "); sb.Append("role_name=@RoleName"); sb.Append(",role_desc=@RoleDesc"); sb.Append(" where role_id = @RoleId"); SqlParameter[] param = { new SqlParameter("@RoleId", SqlDbType.Int), new SqlParameter("@RoleName", SqlDbType.NVarChar, 50), new SqlParameter("@RoleDesc", SqlDbType.NVarChar, 300) }; param[0].Value = dawnAuthRole.RoleId; param[1].Value = dawnAuthRole.RoleName; param[2].Value = dawnAuthRole.RoleDesc; return(SqlHelper.ExecuteNonQuery(Conn.SqlConn, sb.ToString(), param)); }
public string Added(FormCollection form) { var stateInfo = GeneralHandler.StateSuccess; if (AddedByCheck(form, out stateInfo)) { DawnAuthRoleMDL dataInfo = new DawnAuthRoleMDL(); dataInfo.RoleTime = DateTime.Now; dataInfo.RoleName = form["txtName"]; dataInfo.RoleCode = form["txtCode"]; dataInfo.RoleDesc = form["txtDesc"]; bool added = DawnAuthRoleBLL.Exists(string.Format("role_code='{0}'", dataInfo.RoleCode)); if (added) { stateInfo = GeneralHandler.StateAdded; } else { DawnAuthRoleBLL.Insert(dataInfo); } } return(stateInfo); }
/// <summary> /// 删除数据表DawnAuthRole中的一条记录,带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthRole">DawnAuthRole实体对象</param> /// <returns></returns> public int Delete(SqlTransaction sp, DawnAuthRoleMDL dawnAuthRole) { return(DawnAuthRoleBLL._dal.Delete(sp, dawnAuthRole)); }
/// <summary> /// 删除数据表DawnAuthRole中的一条记录 /// </summary> /// <param name="dawnAuthRole">DawnAuthRole实体对象</param> /// <returns></returns> public static int Delete(DawnAuthRoleMDL dawnAuthRole) { return(DawnAuthRoleBLL._dal.Delete(dawnAuthRole)); }