public IActionResult Index()
        {
            var listt = _DeliveryTimeMasterServices.GetAll().Select(x => new DeliveryTimeIndexViewModel
            {
                id = x.id
                ,
                name = x.name
            }).ToList();

            //  return View(storeList);


            return(View(listt));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> StoreDetails()
        {
            ViewBag.Countries    = _CountryRegistrationservices.GetAll().ToList();
            ViewBag.radiusList   = _RadiusMasterServices.GetAll().ToList();
            ViewBag.deliveryList = _DeliveryTimeMasterServices.GetAll().ToList();
            ApplicationUser usr = await GetCurrentUserAsync();

            var id    = usr.Id;
            var store = storedetailsServices.GetAll().Where(x => x.storeid == id).FirstOrDefault();
            var model = new StoreDetailsViewModel();

            if (store == null)
            {
            }
            else
            {
                //             storename, radiusid, deliverytimeid, orderMinAmount, packagingCharges, storeBannerPhoto,
                //address, description, storetim
                int stateid   = 0;
                int countryid = 0;
                int cityyid   = 0;
                if (store.cityid == null)
                {
                }
                else
                {
                    cityyid   = Convert.ToInt32(store.cityid);
                    stateid   = _CityRegistrationservices.GetById(cityyid).stateid;
                    countryid = _StateRegistrationService.GetById(stateid).countryid;
                }


                model.id        = store.id;
                model.storename = store.storename;
                if (store.radiusid == null)
                {
                    model.radiusid = 0;
                }
                else
                {
                    model.radiusid = Convert.ToInt32(store.radiusid.ToString());
                }
                if (store.deliverytimeid == null)
                {
                    model.deliverytimeid = 0;
                }
                else
                {
                    model.deliverytimeid = Convert.ToInt32(store.deliverytimeid.ToString());
                }

                model.orderMinAmount   = store.orderMinAmount;
                model.packagingCharges = store.packagingCharges;
                model.address          = store.address;
                model.description      = store.description;
                // model.storetime = store.storetime;

                if (store.storetime == null || store.storetime.ToString().Trim() == "".Trim())
                {
                    model.FromTime = "";
                    model.ToTime   = "";
                }
                else
                {
                    string[] arr = store.storetime.Split("-");
                    if (arr.Length > 0)
                    {
                        model.FromTime = arr[0].ToString();
                        model.ToTime   = arr[1].ToString();
                    }
                    else
                    {
                    }
                }



                model.promocode = store.promocode;
                model.discount  = store.discount;

                model.adminCommissionPer = store.adminCommissionPer;
                model.taxstatus          = store.taxstatus;
                model.taxstatusPer       = store.taxstatusPer;

                if (store.cityid == null)
                {
                }
                else
                {
                    model.countryid = countryid;
                    model.stateid   = stateid;
                    model.cityid    = cityyid;
                }
                model.latitude             = store.latitude;
                model.longitude            = store.longitude;
                model.storeBannerPhotoName = store.storeBannerPhoto;

                model.accountno    = store.accountno;
                model.bankname     = store.bankname;
                model.banklocation = store.banklocation;
                model.ifsccode     = store.ifsccode;
                model.status       = store.status;
                ViewBag.States     = _StateRegistrationService.GetAllState(model.countryid);
                ViewBag.Cities     = _CityRegistrationservices.GetAllCity(model.stateid);
            }


            return(View(model));
        }