Example #1
0
        public ApiResponse New(string business_id)
        {
            ApiResponse     response     = new ApiResponse();
            var             access_token = Request.Cookies["access_token"];
            ShortCutAddEdit model        = new ShortCutAddEdit();

            model.data = new Shortcut {
                business_id = business_id
            };

            var result = _viewRenderService.RenderToStringAsync("Business/AddShortcut", model).Result;

            response.data = result;
            response.ok   = true;
            return(response);
        }
Example #2
0
        public ApiResponse Edit(string business_id, string id)
        {
            ApiResponse     response     = new ApiResponse();
            var             access_token = Request.Cookies["access_token"];
            ShortCutAddEdit model        = new ShortCutAddEdit();

            var url  = _appSettings.BaseUrls.Api + "brands/shortcuts/single/" + business_id + "/" + id + "/?access_token=" + access_token;
            var data = Core.Helpers.WebHelper.HttpGetAsync <Shortcut>(url).Result;

            if (data == null)
            {
                return(response);
            }
            model.edit = true;
            model.data = data;

            var result = _viewRenderService.RenderToStringAsync("Business/AddShortcut", model).Result;

            response.data = result;
            response.ok   = true;
            return(response);
        }