Beispiel #1
0
 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);
     }
 }
Beispiel #2
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);
     }
 }
Beispiel #3
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);
     }
 }