public bool Edit(Staffs model) { using (var conn = OpenConnection()) { string sql = @"update Staffs set StaffName=@StaffName,UserName=@UserName,UserPwd=@UserPwd,DepartId=@DepartId,RoleId=@RoleId,StaffCode=@StaffCode where Id=@Id "; return(conn.Execute(sql, model) > 0); } }
public bool ChangePwd(Staffs model) { using (var conn = OpenConnection()) { string sql = @"update Staffs set UserPwd=@UserPwd where Id=@Id "; return(conn.Execute(sql, model) > 0); } }
public bool Add(Staffs model) { using (var conn = OpenConnection()) { string sql = "insert into Staffs(StaffName,UserName,UserPwd,DepartId,RoleId,StaffCode) values (@StaffName, @UserName, @UserPwd, @DepartId, @RoleId,@StaffCode)"; return(conn.Execute(sql, model) > 0); } }