Пример #1
0
 public ActionResult Index(BLCompanyDetail client)
 {
     if (ModelState.IsValid)
     {
         var userId = User.Identity.GetUserId();
         client.CreatedBy = userId;
         if (client.ID > 0)
         {
             var result = client.Update();
             if (result.Item1)
             {
                 TempData["SuccessCompany"] = result.Item2;
             }
             else
             {
                 TempData["FailedCompany"] = result.Item2;
             }
         }
         else
         {
             var result = client.Save();
             if (result.Item1)
             {
                 TempData["SuccessCompany"] = result.Item2;
             }
             else
             {
                 TempData["FailedCompany"] = result.Item2;
             }
         }
         return(RedirectToAction("Index"));
     }
     return(View(client));
 }
Пример #2
0
        // GET: Setting
        public ActionResult Index()
        {
            ViewData["SuccessCompany"] = TempData["SuccessCompany"];
            ViewData["FailedCompany"]  = TempData["FailedCompany"];
            var userId  = User.Identity.GetUserId();
            var company = companyDetail.GetById(userId);

            if (company == null)
            {
                company = new BLCompanyDetail();
            }
            var support = bLsupport.GetById(userId);

            if (support == null)
            {
                company.bLSupport = new BLSupport();
            }
            else
            {
                company.bLSupport = support;
            }
            return(View(company));
        }