Пример #1
0
        public async Task <ActionResult> RemoveSetupMenu(int id)
        {
            //string strint = id.Trim().ToString();
            //var intid = Convert.ToInt32(strint);
            List <MenuSetUpViewModel> olist = new List <MenuSetUpViewModel>();

            MenuSetUpViewModelObjectRootModel obj = new MenuSetUpViewModelObjectRootModel();

            string url = GetUrl(2);

            url = url + "MenuSetup/RemoveSetupMenu?id=" + Convert.ToInt32(id) + "";
            using (HttpClient client = new HttpClient())
            {
                HttpResponseMessage responseMessage = await client.GetAsync(url);

                if (responseMessage.IsSuccessStatusCode)
                {
                    var response = responseMessage.Content.ReadAsStringAsync().Result;
                    var settings = new JsonSerializerSettings
                    {
                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore
                    };
                    obj   = JsonConvert.DeserializeObject <MenuSetUpViewModelObjectRootModel>(response, settings);
                    olist = obj.data;
                    ViewBag.TransactionList = olist;
                }
            }
            return(RedirectToAction("Index"));
        }
        public async Task <PartialViewResult> SetupMenu(MenuSetupMasterModel model)
        {
            List <MenuSetUpViewModel> olist = new List <MenuSetUpViewModel>();

            MenuSetUpViewModelObjectRootModel obj = new MenuSetUpViewModelObjectRootModel();

            string url = GetUrl(2);

            url = url + "MenuSetup/SetupMenu?MenuId=" + Convert.ToInt32(model.MenuName) + "&CategoryId=" + Convert.ToInt32(model.CategoryName) + "&ProductId=" + Convert.ToInt32(model.ProductName) + "";
            using (HttpClient client = new HttpClient())
            {
                HttpResponseMessage responseMessage = await client.GetAsync(url);

                if (responseMessage.IsSuccessStatusCode)
                {
                    var response = responseMessage.Content.ReadAsStringAsync().Result;
                    var settings = new JsonSerializerSettings
                    {
                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore
                    };
                    obj   = JsonConvert.DeserializeObject <MenuSetUpViewModelObjectRootModel>(response, settings);
                    olist = obj.data;
                    ViewBag.TransactionList = olist;
                }
            }
            return(PartialView("_MenuSetUplist", olist));
        }
Пример #3
0
        public async Task <PartialViewResult> GetAllMenuListByStore(string StoreName)
        {
            int IntStoreid = Convert.ToInt16(StoreName);
            List <MenuSetUpViewModel> olist = new List <MenuSetUpViewModel>();

            MenuSetUpViewModelObjectRootModel obj = new MenuSetUpViewModelObjectRootModel();

            string url = GetUrl(2);

            url = url + "MenuSetup/GetAllMenuList?storeid=" + IntStoreid;
            using (HttpClient client = new HttpClient())
            {
                HttpResponseMessage responseMessage = await client.GetAsync(url);

                if (responseMessage.IsSuccessStatusCode)
                {
                    var response = responseMessage.Content.ReadAsStringAsync().Result;
                    var settings = new JsonSerializerSettings
                    {
                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore
                    };
                    obj   = JsonConvert.DeserializeObject <MenuSetUpViewModelObjectRootModel>(response, settings);
                    olist = obj.data;
                    ViewBag.TransactionList = olist;
                }
            }
            return(PartialView("_MenuSetUplist", olist));
        }