Beispiel #1
0
 public int Delete(COM_User obj)
 {
     using (Conn)
     {
         string query = @"DELETE FROM COM_User WHERE Username = @Username";
         return(Conn.Execute(query, obj));
     }
 }
Beispiel #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));
     }
 }
Beispiel #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));
     }
 }
Beispiel #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()));
        }
Beispiel #5
0
 public int Delete(COM_User obj)
 {
     return(dal.Delete(obj));
 }
Beispiel #6
0
 public int Insert(COM_User obj)
 {
     return(dal.Insert(obj));
 }
Beispiel #7
0
 public int Update(COM_User obj)
 {
     return(dal.Update(obj));
 }