Example #1
0
 public JsonResult CreateStoreJson(StoreModel model)
 {
     if (ModelState.IsValid)
     {
         model.LogOutUrl = model.BaseUrl;
         var entity = model.ToEntity();
         _storeService.Add(entity);
         return Json(new {success = true,storeId = entity.Id});
     }
     return Json(new { success = false });
 }
        public JsonResult CreateStore(StoreModel model)
        {
            var success = "";
            try
            {
                model.LogOutUrl = model.BaseUrl;
                var entity = model.ToEntity();
                _storeService.Add(entity);
                success = "Brochure Updated";
            }
            catch (Exception)
            {
                success = "Update Failed";
            }

            return Json(success);
        }
Example #3
0
        public ActionResult Edit(StoreModel model)
        {
            try
            {
                //var entity = model.ToEntity();

                //if (string.IsNullOrEmpty(entity.LogOutUrl))
                //  entity.LogOutUrl = model.BaseUrl;
                //    _storeService.AddOrUpdate(entity);

                //  this.SuccessNotification(entity.StoreName + " has been updated");

                return RedirectToAction("Index");
            }
            catch
            {
                this.ErrorNotification("There was an error in updating. Please check the information entered and submit again");
                return View();
            }
        }