示例#1
0
 /// <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));
 }
示例#2
0
 /// <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));
 }
示例#3
0
 /// <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));
 }
示例#4
0
        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);
        }
示例#5
0
        /// <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));
        }
示例#6
0
        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);
        }
示例#7
0
 /// <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));
 }
示例#8
0
 /// <summary>
 /// 删除数据表DawnAuthRole中的一条记录
 /// </summary>
 /// <param name="dawnAuthRole">DawnAuthRole实体对象</param>
 /// <returns></returns>
 public static int Delete(DawnAuthRoleMDL dawnAuthRole)
 {
     return(DawnAuthRoleBLL._dal.Delete(dawnAuthRole));
 }