Esempio n. 1
0
 public static DAL.Clerk DtoToDAL(ClerkDTO clerkDTO)
 {
     DAL.Clerk clerkDAL = new DAL.Clerk();
     clerkDAL.ClerkKey      = clerkDTO.ClerkKey;
     clerkDAL.ClerkFName    = clerkDTO.ClerkFName;
     clerkDAL.ClerkLName    = clerkDTO.ClerkLName;
     clerkDAL.ClerkPassword = clerkDTO.ClerkPassword;
     clerkDAL.IfManager     = clerkDTO.IfManager;
     return(clerkDAL);
 }
Esempio n. 2
0
 public static ClerkDTO AddNewClerk(ClerkDTO newClerk, ref string message)
 {
     DAL.Clerk IfPasswordExists = db.Clerks.FirstOrDefault(c => c.ClerkPassword == newClerk.ClerkPassword);
     if (IfPasswordExists != null)
     {
         message = "סיסמא זו קיימת במערכת, אנא הקש סיסמא חדשה";
         return(null);
     }
     DAL.Clerk clerkDAL = DtoToDAL(newClerk);
     db.Clerks.Add(clerkDAL);
     db.SaveChanges();
     return(newClerk);
 }
Esempio n. 3
0
 public static ClerkDTO ClerkExsits(ClerkDTO clerk)
 {
     return(new ClerkDTO(db.Clerks.FirstOrDefault(p => p.ClerkPassword == clerk.ClerkPassword)));
 }