private InstagramViewModel GetIGSetting(SettingViewModel setting)
        {
            InstagramViewModel ig = null;
            if(setting.value != null)
            {
                ig = JsonConvert.DeserializeObject<InstagramViewModel>(setting.value);
            }
            else
            {
                ig = new InstagramViewModel()
                {
                    id = setting.id,
                    alias = setting.alias,
                    name = setting.name
                };
            }

            return ig;
        }
        public ActionResult EditIG(InstagramViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    SetRequestURL(APIURL.SETTINGS_UPDATE, Method.POST);
                    request.AddBody(new SettingViewModel()
                    {
                        id = model.id,
                        name = model.name,
                        alias = model.alias,
                        value = JsonConvert.SerializeObject(model)
                    });

                    var response = rest.Execute(request);

                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        SetMessage(Message.SuccessfulUpdate("Instagram"), MESSAGE_TYPE.SUCCESS);
                        return RedirectToAction("Details", new { alias = model.alias });
                    }
                    else
                    {
                        ModelState.AddModelError("", response.Content);
                    }
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
            }

            SetTitle("Edit - " + model.name);
            return View("InstagramEdit", model);
        }