Пример #1
0
        public  async Task AddAsync(PersonViewModel personViewModel)
        {

            var person = Mapper.Map<PersonViewModel,Person>(personViewModel);
            await perRep.AddAsync(person);

        }
Пример #2
0
        public async Task<ActionResult> Create(PersonViewModel person)
        {

            person.UserProfileId = User.Identity.GetUserId<int>();
            await peprsonService.AddAsync(person);
            return Content("New person was added");
        }
Пример #3
0
        public async Task<ActionResult> Create(PersonViewModel person)
        {

           await peprsonService.AddAsync(person);
            
           return RedirectToAction("Index");
        }
Пример #4
0
        public  async Task<ActionResult> Edit(PersonViewModel person)
        {
            if (ModelState.IsValid == true)
            {
                await peprsonService.UpdateAsync(person);
                return RedirectToAction("ListOfPerson");
            }
            return     PartialView(person);

        }
Пример #5
0
 public async Task<ActionResult> Edit(PersonViewModel person)
 {
     person.UserProfileId = User.Identity.GetUserId<int>();
     await peprsonService.UpdateAsync(person);
     return Content("Person was deleted");
 }
Пример #6
0
        public async Task<ActionResult> Delete(PersonViewModel person)
        {

            await peprsonService.RemoveAsync(person.Id);
            return RedirectToAction("Index");
        }
Пример #7
0
        public async Task<ActionResult> AddNewPerson(PersonViewModel personViewModel)
        {
            if (ModelState.IsValid == true)
            {
                await peprsonService.AddAsync(personViewModel);
                return RedirectToAction("ListOfPerson");
            }
            else
            {
                return PartialView(personViewModel);

            }
        }
Пример #8
0
 public async Task<ActionResult> Create(PersonViewModel person)
 {
 
     await peprsonService.AddAsync(person);
     return Content("New person was added");
 }