public ActionResult Create(StaffMember sm)
 {
     if (ModelState.IsValid)
     {
         // we use password_hash so we can use declaritive verification
         sm.SetPassword(sm.password_hash);
         _repository.AddStaffMember(sm);
         _repository.Save();
         TempData["Message"] = "Staff Member created";
         return RedirectToAction("Index");
     }
     return View("Create", sm);
 }
 private static void InstallDbAndAddUser(string username, string password, string connString)
 {
     var person = new People
                     {
                         email = "*****@*****.**",
                         name = "Admin",
                         phone_number = "555-555-5555"
                     };
     var sm = new StaffMember
                 {
                     auth_name = username,
                     People = person
                 };
     sm.SetPassword(password);
     var repo = new ConferencewareRepository(connString);
     if (repo.DatabaseExists())
     {
         repo.DeleteDatabase();
     }
     repo.CreateDatabase();
     repo.AddStaffMember(sm);
     repo.Save();
 }
Пример #3
0
 public void DeleteStaffMember(StaffMember sm)
 {
     _staffMembers.Remove(sm);
 }
Пример #4
0
 public void AddStaffMember(StaffMember sm)
 {
     sm.People.id = ++_personMaxId;
     _staffMembers.Add(sm);
 }
 public void DeleteStaffMember(StaffMember sm)
 {
     _conferenceware.StaffMembers.DeleteOnSubmit(sm);
 }
 public void AddStaffMember(StaffMember sm)
 {
     _conferenceware.StaffMembers.InsertOnSubmit(sm);
 }
 partial void DeleteStaffMember(StaffMember instance);
 partial void UpdateStaffMember(StaffMember instance);
 partial void InsertStaffMember(StaffMember instance);