Ejemplo n.º 1
0
        public ActionResult _EditCustomerEmployer(CustomerEmployer mEmployer)
        {
            var cus = _customerService.GetCustomer(mEmployer.CustomerId);

            if (cus.CustomerEmployer == null)
            {
                cus.CustomerEmployer = new CustomerEmployer {
                    EmployerId = -1
                }
            }
            ;
            if (TryUpdateModel(cus.CustomerEmployer))
            {
                if (ExecuteRepositoryAction(() =>
                {
                    if (cus.CustomerEmployer.EmployerId == -1)
                    {
                        _customerService.DeleteCustomerEmployer(cus.CustomerEmployer);
                    }
                    else
                    {
                        _customerService.UpdateCustomer(cus);
                    }
                    _customerService.CommitChanges();
                }))
                {
                    return(Json(new { success = true }));
                }
            }

            return(PartialView(mEmployer));
        }
Ejemplo n.º 2
0
 public ActionResult CreateCustomerStep2(CustomerEmployer mCustomerEmployer)
 {
     if (ModelState.IsValid)
     {
         if (TryUpdateModel(TempCustomer.CustomerEmployer))
         {
             if (TempCustomer.CustomerEmployer.EmployerId == -1)
             {
                 TempCustomer.CustomerEmployer   = null;
                 TempCustomer.CustomerEmployerId = null;
             }
             return(RedirectToAction(Stepper2.NextStep()));
         }
     }
     ViewBag.Employers = AddAllSelector <Employer>(new Employer {
         EmployerId = -1, EmployerName = " ---"
     },
                                                   ViewBag.Employers);
     return(View(mCustomerEmployer));
 }
Ejemplo n.º 3
0
 public void DeleteCustomerEmployer(CustomerEmployer customerEmployer)
 {
     _CustomerEmployerContext.Remove(customerEmployer);
 }
Ejemplo n.º 4
0
 public void DeleteCustomerEmployer(CustomerEmployer customerEmployer)
 {
     _customerRepository.DeleteCustomerEmployer(customerEmployer);
 }