예제 #1
0
        public ActionResult Update([ModelBinder(typeof(DevExpressEditorsBinder))]  GeneralSettingModel generalSettingModel)
        {
            generalSettingModel._UserId = (int)Session["userId"];
            generalSettingService       = new GeneralSettingService();


            if (ModelState.IsValid)
            {
                generalSettingService.Update(generalSettingModel);
                generalSettingModel = generalSettingService.GetById(generalSettingModel.Id);
            }
            else
            {
                string message = GetErrorModel();

                throw new Exception(string.Format("[VALIDATION] {0}", message));
            }

            return(PartialView(VIEW_FORM_PARTIAL, generalSettingModel));
        }
        public ActionResult Update(GeneralSettingDTO data)
        {
            GeneralSetting General = _generalSettingService.GetByID(data.ID);

            General.ID             = data.ID;
            General.Email          = data.Email;
            General.Telephone      = data.Telephone;
            General.Facebook       = data.Facebook;
            General.Twitter        = data.Twitter;
            General.instagram      = data.instagram;
            General.Pinterest      = data.Pinterest;
            General.Youtube        = data.Youtube;
            General.CopyrightText  = data.CopyrightText;
            General.Googleplay     = data.Googleplay;
            General.AppStore       = data.AppStore;
            General.SeoTitle       = data.SeoTitle;
            General.SeoDescription = data.SeoDescription;
            _generalSettingService.Update(General);
            TempData["Successful"] = "Transaction is successful.";
            //return Redirect("/Admin/GeneralSetting/Update");
            return(RedirectToAction("List"));
        }