Пример #1
0
        public ActionResult Edit(Distributor distributor)
        {
            if (ModelState.IsValid)
            {
                _upriseContext.Entry(distributor).State = EntityState.Modified;
                _upriseContext.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(new JsonResult(new { success = true, Response = Serializer.DeserializeDistributor(distributor) }));
        }
Пример #2
0
 public void Update(Campaign campaign)
 {
     try
     {
         _upriseContext.Entry(campaign).State = EntityState.Modified;
         _upriseContext.SaveChanges();
     }
     catch (Exception ex)
     {
         var message = "";
         ErrorHelper.GetExceptionMessages(ex, message);
         throw new Exception(message);
     }
 }