示例#1
0
 public int Delete(COM_User obj)
 {
     using (Conn)
     {
         string query = @"DELETE FROM COM_User WHERE Username = @Username";
         return(Conn.Execute(query, obj));
     }
 }
示例#2
0
 public int Insert(COM_User obj)
 {
     using (Conn)
     {
         string query = @"INSERT INTO COM_User 
                             VALUES(@Code,@Name,@Username,@Password,@Role,@Tel,@Address,@Department,@IP)";
         return(Conn.Execute(query, obj));
     }
 }
示例#3
0
 public int Update(COM_User obj)
 {
     using (Conn)
     {
         string query = @"UPDATE COM_User 
                             SET  Code=@Code,Name=@Name,Username=@Username,Password=@Password,
                                  Role=@Role,Tel=@Tel,Address=@Address,Department=@Department,IP=@IP
                                WHERE Username =@Username";
         return(Conn.Execute(query, obj));
     }
 }
示例#4
0
        public ActionResult ModifyPassword(string Username, string Password, string newPassword)
        {
            int      isOk = default(int);
            COM_User user = icom_userbll.GetEntity(Username);

            Password = EncryptUtils.MD5Encrypt(Password.Trim());

            if (user.Password == Password)
            {
                user.Password = EncryptUtils.MD5Encrypt(newPassword.Trim());
                isOk          = icom_userbll.Update(user);
            }
            else
            {
                isOk = -1;
            }
            return(Content(isOk.ToString()));
        }
示例#5
0
 public int Delete(COM_User obj)
 {
     return(dal.Delete(obj));
 }
示例#6
0
 public int Insert(COM_User obj)
 {
     return(dal.Insert(obj));
 }
示例#7
0
 public int Update(COM_User obj)
 {
     return(dal.Update(obj));
 }