public IActionResult Edit(int id) { var storeowner = _DeliveryTimeMasterServices.GetById(id); if (storeowner == null) { return(NotFound()); } var model = new DeliveryTimeEditViewModel() { id = storeowner.id, name = storeowner.name, }; return(View(model)); }
public async Task <IActionResult> storeDetails(string id) { var users = await usermanager.FindByIdAsync(id); if (users == null) { ViewBag.ErrorMessgae = "User with id =" + id + "cannot be found"; return(View("NotFound")); } var model = new StoreShowDetailsViewModel() { storeid = users.Id, storeownerName = users.name, mobileno = users.mobileno, ownergender = users.gender, profilephoto = users.profilephoto, Email = users.Email }; //byte[] decodedHashedPassword = Convert.FromBase64String(users.PasswordHash); // string pass = base64Decode(users.PasswordHash); if (model.storeid != null) { var storedetails = _storedetailsServices.GetAll().Where(x => x.storeid == model.storeid).FirstOrDefault(); if (storedetails != null) { model.contactpersonname = storedetails.contactpersonname; model.emailaddress = storedetails.emailaddress; model.contactno = storedetails.contactno; model.gender = storedetails.gender; model.fooddelivery = storedetails.fooddelivery; model.storename = storedetails.storename; model.radiusid = _RadiusMasterServices.GetById(Convert.ToInt32(storedetails.radiusid)).name; model.deliverytimeid = _DeliveryTimeMasterServices.GetById(Convert.ToInt32(storedetails.deliverytimeid)).name; model.orderMinAmount = storedetails.orderMinAmount; model.packagingCharges = storedetails.packagingCharges; model.storeBannerPhoto = storedetails.storeBannerPhoto; model.address = storedetails.address; model.description = storedetails.description; model.storetime = storedetails.storetime; model.licPhoto = storedetails.licPhoto; model.latitude = storedetails.latitude; model.longitude = storedetails.longitude; if (storedetails.radiusid != null) { int cityidd = Convert.ToInt32(storedetails.radiusid); int stateid = _cityRegistrationservices.GetById(cityidd).stateid; int countryid = _StateRegistrationService.GetById(stateid).countryid; model.country = _CountryRegistrationservices.GetById(countryid).countryname; model.state = _StateRegistrationService.GetById(countryid).StateName; model.cityid = _cityRegistrationservices.GetById(cityidd).cityName; } } } return(View(model)); }