Example #1
0
        /// <summary>
        /// 更新管理员信息
        /// </summary>
        /// <param name="manage">管理员对象</param>
        /// <param name="manageNum">管理员编号</param>
        /// <returns></returns>
        public static bool UptManage(Model.ManageModel manage)
        {
            bool n = false;

            try
            {
                SqlParameter[] paras = new SqlParameter[] {
                    GetSqlParameter("@id", SqlDbType.Int, manage.ID),
                    GetSqlParameter("@Number", SqlDbType.VarChar, manage.Number),
                    GetSqlParameter("@Name", SqlDbType.VarChar, manage.Name),
                    GetSqlParameter("@Post", SqlDbType.VarChar, manage.Post),
                    GetSqlParameter("@Branch", SqlDbType.VarChar, manage.Branch),
                    GetSqlParameter("@Status", SqlDbType.Int, manage.Status),
                    GetSqlParameter("@PermissionMan", SqlDbType.VarChar, manage.PermissionMan),
                    GetSqlParameter("@RoleID", SqlDbType.Int, manage.RoleID),
                    GetSqlParameter("@IsViewPermissions", SqlDbType.Int, manage.IsViewPermissions),
                    GetSqlParameter("@IsRecommended", SqlDbType.Int, manage.IsRecommended)
                };
                n = DBHelper.ExecuteNonQuery("UptManage", paras, CommandType.StoredProcedure) == 1;
            }
            catch (SqlException)
            {
                //throw new Exception("修改管理员信息产生异常!");
                return(false);
            }
            return(n);
        }
Example #2
0
 /// <summary>
 /// 添加新管理员
 /// </summary>
 /// <param name="manage">管理员对象</param>
 /// <param name="manageNum">管理员编号</param>
 /// <returns></returns>
 public static int AddManage(Model.ManageModel manage, string manageNum)
 {
     try
     {
         SqlParameter[] paras = new SqlParameter[] {
             GetSqlParameter("@Number", SqlDbType.VarChar, manage.Number),
             GetSqlParameter("@Name", SqlDbType.VarChar, manage.Name),
             GetSqlParameter("@Post", SqlDbType.VarChar, manage.Post),
             GetSqlParameter("@Branch", SqlDbType.VarChar, manage.Branch),
             GetSqlParameter("@LoginPass", SqlDbType.VarChar, manage.LoginPass),
             GetSqlParameter("@BeginDate", SqlDbType.DateTime, manage.BeginDate),
             GetSqlParameter("@LastLoginDate", SqlDbType.SmallDateTime, manage.LastLoginDate),
             GetSqlParameter("@State", SqlDbType.Int, manage.Status),
             GetSqlParameter("@PermissionMan", SqlDbType.NVarChar, manage.PermissionMan),
             GetSqlParameter("@RoleID", SqlDbType.Int, manage.RoleID),
             GetSqlParameter("@IsViewPermissions", SqlDbType.Int, manage.IsViewPermissions),
             GetSqlParameter("@IsRecommended", SqlDbType.Int, manage.IsRecommended)
         };
         return(DBHelper.ExecuteNonQuery("AddManage", paras, CommandType.StoredProcedure));
     }
     catch (SqlException)
     {
         return(-1);
     }
 }