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