public ActionResult EditPersonalInformation(UserProfile userProfile) { UserDomainLogic userdomainLogic = new UserDomainLogic(); userProfile.UserAddresses = new List <UserAddress>(); UserAddress usrAddress = new UserAddress(); Guid cityGuid = Guid.Empty; usrAddress.UserAddressGuid = Guid.Parse(HttpContext.Request.Form["BillingAddress_UserAddressGuid"]); usrAddress.Address = Convert.ToString(HttpContext.Request.Form["BillingAddress.Address"]); usrAddress.PostCode = Convert.ToString(HttpContext.Request.Form["BillingAddress.PostCode"]); Guid.TryParse(HttpContext.Request.Form["BillingAddress.CityGuid"], out cityGuid); usrAddress.CityGuid = cityGuid; usrAddress.AddressType = Bringly.Domain.Enums.User.UserAddressType.Billing.ToString(); if (usrAddress.CityGuid != Guid.Empty) { userProfile.UserAddresses.Add(usrAddress); } usrAddress = new UserAddress(); usrAddress.UserAddressGuid = Guid.Parse(HttpContext.Request.Form["ShippingAddress_UserAddressGuid"]); usrAddress.Address = Convert.ToString(HttpContext.Request.Form["ShippingAddress.Address"]); usrAddress.PostCode = Convert.ToString(HttpContext.Request.Form["ShippingAddress.PostCode"]); Guid.TryParse(HttpContext.Request.Form["ShippingAddress.CityGuid"], out cityGuid); usrAddress.CityGuid = cityGuid; usrAddress.AddressType = Bringly.Domain.Enums.User.UserAddressType.Shipping.ToString(); userProfile.UserAddresses.Add(usrAddress); userdomainLogic.UpdateUserProfile(userProfile); TempData["Success"] = "Saved successfully"; CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); userProfile.Cities = commonDomainLogic.GetCities(); return(RedirectToAction("PersonalInformation")); }
/// <summary> /// /// </summary> /// <returns></returns> public BusinessObject Newbusiness() { BusinessObject BusinessObject = new BusinessObject(); CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); BusinessObject.BusinessTypeList = GetBusinessTypes(); BusinessObject.CityList = commonDomainLogic.GetCities(); BusinessObject.CVRNumber = bringlyEntities.tblUsers .Where(x => x.UserGuid == UserVariables.LoggedInUserGuid) .FirstOrDefault().CVRNumber; BusinessObject.Managers = bringlyEntities.tblManagers .Where(x => x.CreatedByGuid == UserVariables.LoggedInUserGuid && x.IsDeleted == false) .Select(x => new Manager { BranchGuid = x.BranchGuid, BusinessGuid = x.BusinessGuid, CreatedByGuid = x.CreatedByGuid, DateCreated = x.DateCreated, ManagerGuid = x.ManagerGuid, Name = bringlyEntities.tblUsers.Where(z => z.UserGuid == x.UserGuid).Select(z => z.FullName).FirstOrDefault() }).ToList(); return(BusinessObject); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult City(string id) { RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); CommonDomainLogic _commonDomainLogic = new CommonDomainLogic(); ChooseCity chooseCity = new ChooseCity(); if (!string.IsNullOrEmpty(id)) { Guid _cityguid = _commonDomainLogic.FindCityGuid(id); UserDomainLogic _userDomainLogic = new UserDomainLogic(); _userDomainLogic.UpdatePreferedCity(_cityguid); chooseCity.Cities = _commonDomainLogic.GetCityByGUID(_cityguid); chooseCity.SelectedCity = new City { CityName = chooseCity.Cities.FirstOrDefault().CityName, CityGuid = chooseCity.Cities.FirstOrDefault().CityGuid, CityUrlName = chooseCity.Cities.FirstOrDefault().CityUrlName }; } else { chooseCity.Cities = _commonDomainLogic.GetCities(); chooseCity.SelectedCity = new City { CityName = chooseCity.Cities.FirstOrDefault().CityName, CityGuid = chooseCity.Cities.FirstOrDefault().CityGuid, CityUrlName = chooseCity.Cities.FirstOrDefault().CityUrlName }; } return(View("ListRestaurants", restaurantDomainLogic.GetRestaurantsByCity(chooseCity.SelectedCity))); }
public ActionResult NewRegistrationfromSocialPage(UserProfile userProfile) { Guid cityGuid = Guid.Empty; UserDomainLogic userdomainLogic = new UserDomainLogic(); userProfile.UserAddresses = new List <UserAddress>(); UserAddress usrAddress = new UserAddress(); usrAddress.Address = Convert.ToString(HttpContext.Request.Form["BillingAddress.Address"]); usrAddress.PostCode = Convert.ToString(HttpContext.Request.Form["BillingAddress.PostCode"]); Guid.TryParse(HttpContext.Request.Form["BillingAddress_CityGuid"], out cityGuid); usrAddress.CityGuid = cityGuid; var billingCityName = Convert.ToString(HttpContext.Request.Form["BillingAddress.CityName"]); var shippingCityName = Convert.ToString(HttpContext.Request.Form["ShippingAddress.CityName"]); CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); if (!string.IsNullOrEmpty(billingCityName) && usrAddress.CityGuid == Guid.Empty) { Bringly.Domain.City city = new Domain.City { CityGuid = Guid.NewGuid(), CityName = billingCityName, CityUrlName = billingCityName }; commonDomainLogic.AddCity(city); usrAddress.CityGuid = city.CityGuid; } usrAddress.AddressType = Bringly.Domain.Enums.User.UserAddressType.Billing.ToString(); userProfile.UserAddresses.Add(usrAddress); usrAddress = new UserAddress(); usrAddress.Address = Convert.ToString(HttpContext.Request.Form["ShippingAddress.Address"]); usrAddress.PostCode = Convert.ToString(HttpContext.Request.Form["ShippingAddress.PostCode"]); Guid.TryParse(HttpContext.Request.Form["ShippingAddress_CityGuid"], out cityGuid); usrAddress.CityGuid = cityGuid; if (!string.IsNullOrEmpty(shippingCityName) && usrAddress.CityGuid == Guid.Empty && !billingCityName.Equals(shippingCityName)) { Bringly.Domain.City city = new Domain.City { CityGuid = Guid.NewGuid(), CityName = shippingCityName, CityUrlName = shippingCityName }; commonDomainLogic.AddCity(city); usrAddress.CityGuid = city.CityGuid; } usrAddress.AddressType = Bringly.Domain.Enums.User.UserAddressType.Shipping.ToString(); userProfile.UserAddresses.Add(usrAddress); userdomainLogic.UpdateUserProfile(userProfile); Success("Saved successfully"); userProfile.Cities = commonDomainLogic.GetCities(); return(RedirectToAction("Dashboard", "User")); }
public ActionResult EditPersonalInformation() { UserDomainLogic userDomainLogic = new UserDomainLogic(); UserProfile userProfile = userDomainLogic.FindUser(UserVariables.LoggedInUserGuid); CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); userProfile.Cities = commonDomainLogic.GetCities(); return(View(userProfile)); }
/// <summary> /// /// </summary> /// <param name="guid"></param> /// <returns></returns> public ActionResult AddEditManager(Nullable <Guid> guid) { UserProfile userProfile = new UserProfile(); UserDomainLogic userDomainLogic = new UserDomainLogic(); CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); if (guid != null && guid != Guid.Empty) { userProfile = userDomainLogic.FindUser(guid.Value); userProfile.Cities = commonDomainLogic.GetCities(); userProfile.RolesList = commonDomainLogic.GetAllRoles(); } else { userProfile.Cities = commonDomainLogic.GetCities(); userProfile.RolesList = commonDomainLogic.GetAllRoles(); } return(View(userProfile)); }
public PartialViewResult ChoosePreferedCity() { CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); UserDomainLogic _userDomainLogic = new UserDomainLogic(); ChooseCity chooseCity = new ChooseCity(); UserProfile _FindUser = _userDomainLogic.FindUser(UserVariables.LoggedInUserGuid); chooseCity.Cities = commonDomainLogic.GetCities(); chooseCity.SelectedCity = commonDomainLogic.GetPreferedCity(); chooseCity.TopCities = commonDomainLogic.GetTopCities(chooseCity.SelectedCity); return(PartialView("_chooseCity", chooseCity)); }
public ActionResult AddEditManager(UserProfile userProfile) { UserDomainLogic userdomainLogic = new UserDomainLogic(); userdomainLogic.AddUpdateUser(userProfile); TempData["Success"] = "Saved successfully"; CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); userProfile.Cities = commonDomainLogic.GetCities(); userProfile.RolesList = commonDomainLogic.GetAllRoles(); return(RedirectToAction("ManageManagers")); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="BusinessTypeGuid"></param> /// <param name="LocationGuid"></param> /// <returns></returns> public ActionResult LocationListUser(string id, Nullable <Guid> BusinessTypeGuid, Nullable <Guid> LocationGuid) { BusinessDomainLogic businessDomainLogic = new BusinessDomainLogic(); CommonDomainLogic _commonDomainLogic = new CommonDomainLogic(); ChooseCity chooseCity = new ChooseCity(); TempData["SelectedBusinessTypeGuid"] = BusinessTypeGuid; if (!string.IsNullOrEmpty(id)) { Guid _cityguid = _commonDomainLogic.FindCityGuid(id); UserDomainLogic _userDomainLogic = new UserDomainLogic(); _userDomainLogic.UpdatePreferedCity(_cityguid); chooseCity.Cities = _commonDomainLogic.GetCityByGUID(_cityguid); chooseCity.SelectedCity = new City { CityName = chooseCity.Cities.FirstOrDefault().CityName, CityGuid = chooseCity.Cities.FirstOrDefault().CityGuid, CityUrlName = chooseCity.Cities.FirstOrDefault().CityUrlName }; } else { UserDomainLogic userDomainLogic = new UserDomainLogic(); string guid = userDomainLogic.FindUser(UserVariables.LoggedInUserGuid).PreferedCity; if (!string.IsNullOrEmpty(guid)) { chooseCity.Cities = _commonDomainLogic.GetCityByGUID(new Guid(guid)); } else { chooseCity.Cities = _commonDomainLogic.GetCities(); } chooseCity.SelectedCity = new City { CityName = chooseCity.Cities.FirstOrDefault().CityName, CityGuid = chooseCity.Cities.FirstOrDefault().CityGuid, CityUrlName = chooseCity.Cities.FirstOrDefault().CityUrlName }; } int Currentpage = 0; TempData["CurrentPage"] = null; if (LocationGuid == null || LocationGuid == Guid.Empty) { if (Request.Url.AbsoluteUri.Contains('?') && Request.Url.AbsoluteUri.Contains("page")) { TempData["CurrentPage"] = Request.Url.AbsoluteUri.Split('&')[1].Split('=')[1].Split('&')[0]; Currentpage = TempData["CurrentPage"] == null ? 0 : Convert.ToInt32(TempData["CurrentPage"]); TempData.Keep(); } } return(View(businessDomainLogic.GetBusinessByCity(chooseCity.SelectedCity, BusinessTypeGuid, Currentpage))); }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult NewRegistrationfromSocialPage() { bool isFromSocialMedia = Convert.ToBoolean(QueryStringHelper.getValue("sm")); if (!isFromSocialMedia) { isFromSocialMedia = TempData["isFromSocialMedia"] == null ? false : (bool)TempData["isFromSocialMedia"]; } ViewBag.isFromSocialMedia = isFromSocialMedia; UserDomainLogic userDomainLogic = new UserDomainLogic(); BusinessDomainLogic businessDomainLogic = new BusinessDomainLogic(); UserProfile userProfile = userDomainLogic.FindUser(UserVariables.LoggedInUserGuid); CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); userProfile.BusinessTypeList = businessDomainLogic.GetBusinessTypes(); userProfile.Cities = commonDomainLogic.GetCities(); userProfile.Cities.Add(new Domain.City { CityGuid = Guid.Empty, CityName = "Other", CityUrlName = "Other" }); ViewBag.isFromSocialMedia = isFromSocialMedia; return(View(userProfile)); }
// Get Location by Guid /// <summary> /// /// </summary> /// <param name="businessGuid"></param> /// <returns></returns> public BusinessObject GetLocationByGuid(Guid businessGuid) { BusinessObject business = new BusinessObject(); CommonDomainLogic commonDomainLogic = new CommonDomainLogic(); List <City> list = commonDomainLogic.GetCities(); business = bringlyEntities.tblBranches.Where(x => x.BranchGuid == businessGuid && x.IsDeleted == false).Select(r => new BusinessObject { BusinessImage = r.BranchImage, BusinessGuid = r.BranchGuid, BusinessName = r.BranchName, CityGuid = r.FK_CityGuid, BusinessTypeGuid = r.FK_BusinessTypeGuid, PNumber = r.PNumber, Phone = r.Phone, PinCode = r.PinCode, CreatedByGuid = r.FK_CreatedByGuid, ManagerGuid = r.ManagerUserGuid, Address = r.Address, Email = r.Email, OrderTiming = r.OrderTiming, PickUpTiming = r.PickUpTiming, ServiceCharge = r.ServiceCharge, ServiceTax = r.ServiceTax, FlatRate = r.FlatRate, RateAfterKm = r.RateAfterKm, Description = r.Description, Latitude = r.Latitude, Longitude = r.Longitude, PlaceId = r.PlaceId, CountryName = r.Country, AboutUsDescription = r.tblMerchantAboutUsPages.Where(x => x.FK_BranchGuid == r.BranchGuid).Select(x => x.Description).FirstOrDefault(), AboutUsTitle = r.tblMerchantAboutUsPages.Where(x => x.FK_BranchGuid == r.BranchGuid).Select(x => x.Title).FirstOrDefault(), AboutUsPageGuid = r.tblMerchantAboutUsPages.Where(x => x.FK_BranchGuid == r.BranchGuid).Select(x => x.AboutUsPageGuid).FirstOrDefault() }).FirstOrDefault(); business.CityList = list; business.BusinessTypeName = bringlyEntities.tblBusinessTypes .Where(c => c.BusinessTypeGuid == business.BusinessTypeGuid) .FirstOrDefault() .BusinessTypeName; business.CustomPropertyList = bringlyEntities.tblCustomProperties .Where(x => x.LocationGuid == businessGuid) .Select(z => new CustomProperty { CustomPropertyGuid = z.CustomPropertyGuid, LocationGuid = z.LocationGuid, Field = z.Field, Value = z.Value, }) .ToList(); business.CityName = business.CityGuid != Guid.Empty ? bringlyEntities.tblCities.Where(x => x.CityGuid == business.CityGuid).FirstOrDefault().CityName : ""; business.CVRNumber = bringlyEntities.tblUsers.Where(x => x.UserGuid == UserVariables.LoggedInUserGuid).FirstOrDefault().CVRNumber; business.Managers = bringlyEntities.tblManagers.Where(x => x.CreatedByGuid == UserVariables.LoggedInUserGuid && x.IsDeleted == false).Select(x => new Manager { BranchGuid = x.BranchGuid, BusinessGuid = x.BusinessGuid, CreatedByGuid = x.CreatedByGuid, DateCreated = x.DateCreated, ManagerGuid = x.ManagerGuid, Name = bringlyEntities.tblUsers.Where(z => z.UserGuid == x.UserGuid).Select(z => z.FullName).FirstOrDefault() }).ToList(); return(business); }