예제 #1
0
        public IActionResult SignUp(string UserType)
        {
            if (UserType == "Vendor")
            {
                SignUpVendorVM model = new SignUpVendorVM();
                model.Area = _listOfAll.GetArea()?.Select(p => new SelectListItem()
                {
                    Text  = p.AreaName,
                    Value = p.Id.ToString()
                }).ToList();
                model.Category = _listOfAll.GetCategory()?.Select(p => new SelectListItem()
                {
                    Text  = p.Name,
                    Value = p.Id.ToString()
                }).ToList();
                model.Cuisine = _listOfAll.GetCuisine()?.Select(p => new SelectListItem()
                {
                    Text  = p.Name,
                    Value = p.Id.ToString()
                }).ToList();

                model.NunberOfLocation = new List <SelectListItem>()
                {
                    new SelectListItem()
                    {
                        Value = "1 - 4", Text = "1 - 4"
                    },
                    new SelectListItem()
                    {
                        Value = "4 - 10", Text = "4 - 10"
                    },
                    new SelectListItem()
                    {
                        Value = "10 - 20", Text = "10 - 20"
                    }
                };


                return(PartialView("_VendorSignUp", model));
            }
            else if (UserType == "User")
            {
                return(PartialView("_User_SigUp"));
            }
            else
            {
                SignUpDriverVM model = new SignUpDriverVM();
                model.Area = _listOfAll.GetArea()?.Select(p => new SelectListItem()
                {
                    Text  = p.AreaName,
                    Value = p.Id.ToString()
                }).ToList();
                return(PartialView("_Driver_SigUp", model));
            }
        }
예제 #2
0
        private Task <List <CuisineListVM> > GetItemsAsync(int subjectId)
        {
            var data = _listOfAll.GetCuisine().ToList();
            List <CuisineListVM> model = new List <CuisineListVM>();

            if (data != null)
            {
                foreach (var item in data)
                {
                    CuisineListVM listVM = new CuisineListVM();
                    listVM.Id   = item.Id;
                    listVM.Name = item.Name;
                    model.Add(listVM);
                }
            }
            return(Task.FromResult(model));
        }
예제 #3
0
        public IActionResult AddVendor()
        {
            SignUpVendorVM model = new SignUpVendorVM();

            model.Area = _listOfAll.GetArea()?.Select(p => new SelectListItem()
            {
                Text  = p.AreaName,
                Value = p.Id.ToString()
            }).ToList();
            model.Category = _listOfAll.GetCategory()?.Select(p => new SelectListItem()
            {
                Text  = p.Name,
                Value = p.Id.ToString()
            }).ToList();
            model.Cuisine = _listOfAll.GetCuisine()?.Select(p => new SelectListItem()
            {
                Text  = p.Name,
                Value = p.Id.ToString()
            }).ToList();

            model.NunberOfLocation = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Value = "1 - 4", Text = "1 - 4"
                },
                new SelectListItem()
                {
                    Value = "4 - 10", Text = "4 - 10"
                },
                new SelectListItem()
                {
                    Value = "10 - 20", Text = "10 - 20"
                }
            };


            return(View(model));
        }