Exemple #1
0
 public static user_account InsertUser(user_account user)
 {
     using (var db = new RescueEntities())
     {
         user.password   = Cryptography.GetMD5Hash(user.mobile_number + user.password);
         user.created_dt = DateTime.Now;
         db.user_account.Add(user);
         db.SaveChanges();
         return(user);
     }
 }
Exemple #2
0
 public static user_account UpdateUser(user_account user)
 {
     using (var db = new RescueEntities())
     {
         var temp = db.user_account.Find(user.id);
         //  temp.password = Cryptography.GetMD5Hash(user.mobile_number + user.password);
         //  temp.mobile_number = user.mobile_number;
         temp.hospital_name   = user.hospital_name;
         temp.department_name = user.department_name;
         temp.gender          = user.gender;
         temp.birthday        = user.birthday;
         temp.name            = user.name;
         temp.title           = user.title;
         temp.email           = user.email;
         db.SaveChanges();
         return(temp);
     }
 }