/// <summary>
        ///
        /// </summary>
        /// <param name="EmailGuid"></param>
        /// <param name="Isreply"></param>
        /// <returns></returns>
        public ActionResult ComposeEmail(Nullable <Guid> EmailGuid, Nullable <bool> Isreply)
        {
            ComposeEmail     ComposeEmail     = new ComposeEmail();
            UserDomainLogic  UserDomainLogic  = new UserDomainLogic();
            EmailDomainLogic EmailDomainLogic = new EmailDomainLogic();

            ViewBag.PopupTitle = "Send Message";
            if (EmailGuid != null && EmailGuid != Guid.Empty)
            {
                ComposeEmail = EmailDomainLogic.GetEmailByEmailGuid(EmailGuid.HasValue ? EmailGuid.Value : Guid.Empty);
                ComposeEmail.EmailMessage.Body    = "<br><hr>" + ComposeEmail.EmailMessage.Body;
                ComposeEmail.EmailMessage.Subject = (Isreply.HasValue ? (Isreply.Value ? "Re: " : "Fwd: ") : "") + ComposeEmail.EmailMessage.Subject;
                // ComposeEmail.EmailMessage.EmailTo = (Isreply.HasValue ? (Isreply.Value ? ComposeEmail.EmailMessage.EmailTo : "") : "");
                ComposeEmail.Isemailreplyorforward = true;
            }
            if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Buyer)
            {
                ComposeEmail.UserContactList = UserDomainLogic.GetAllMerchants();
            }
            else
            {
                ComposeEmail.UserContactList = UserDomainLogic.GetAllBuyers();
            }

            return(PartialView("_ComposeEmail", ComposeEmail));
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="myreview"></param>
        /// <returns></returns>
        public ActionResult MerchantReview(MyReview myreview)
        {
            if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Merchant || UserVariables.UserRole == Domain.Enums.User.UserRoles.Manager)
            {
                int Currentpage = 0;
                TempData["CurrentPage"] = null;

                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();
                }

                UserDomainLogic userDomainLogic = new UserDomainLogic();
                myreview.UserGuid = UserVariables.LoggedInUserGuid;
                return(View(userDomainLogic.GetMyReviewMerchant(myreview, Currentpage)));
            }
            else
            {
                //Unauthorize unauthorize = new Unauthorize();
                //string url = Request.Url.AbsoluteUri;
                //unauthorize.ReturnUrl = url.Split(new[] { '?' })[0];
                return(View("UnauthorizedAccess"));
            }
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        public ActionResult EditRole(Guid id)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            UserRole        role            = userDomainLogic.GetRole(id);

            return(PartialView("SaveRole", role));
        }
Esempio n. 5
0
        public ActionResult MerchantSettings()
        {
            ViewBag.isPopUpOpen = TempData["isPopUpOpen"];

            if (TempData["hasError"] != null && (bool)TempData["hasError"] == true)
            {
                ErrorBlock(Convert.ToString(TempData["message"]));
            }

            else if (TempData["hasError"] != null && (bool)TempData["hasError"] == false)
            {
                Success(Convert.ToString(TempData["message"]));
            }

            if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Merchant)
            {
                UserDomainLogic userDomainLogic = new UserDomainLogic();
                return(View("Settings", userDomainLogic.IsSelfDeliveryActive(UserVariables.LoggedInUserGuid)));
            }
            else if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Buyer)
            {
                return(View("Settings", false));
            }
            else
            {
                //unauthorizes

                return(View("UnauthorizedAccess"));
            }
        }
Esempio n. 6
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult Dashboard()
        {
            UserDomainLogic   userdomainLogic   = new UserDomainLogic();
            Dashboard         dashboard         = new Dashboard();
            OrderDomainLogic  orderDomainLogic  = new OrderDomainLogic();
            WalletDomainLogic walletDomainLogic = new WalletDomainLogic();

            dashboard.MyMessage = userdomainLogic.GetMyMessages(UserVariables.LoggedInUserGuid);

            if (UserVariables.UserRole == Bringly.Domain.Enums.User.UserRoles.Buyer)
            {
                dashboard.MyFavourites = userdomainLogic.FavouriteLocations(2);
            }

            else
            {
                dashboard.MyFavourites = null;
            }

            if (UserVariables.UserRole == Bringly.Domain.Enums.User.UserRoles.Merchant)
            {
                MyReview myreview = new MyReview();
                myreview.UserGuid  = UserVariables.LoggedInUserGuid;
                dashboard.MyReview = userdomainLogic.GetMyReviewMerchant(myreview);
                dashboard.MyReview.GivenBusinessReviews = dashboard.MyReview.GivenBusinessReviews.Count > 0 ? dashboard.MyReview.GivenBusinessReviews.Take(2).ToList() : dashboard.MyReview.GivenBusinessReviews;
            }

            dashboard.Wallet  = walletDomainLogic.GetWallet(UserVariables.LoggedInUserGuid);
            dashboard.MyOrder = orderDomainLogic.GetMyOrderCounts(UserVariables.LoggedInUserGuid, UserVariables.UserRole);

            return(View(dashboard));
        }
Esempio n. 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="CityGuid"></param>
        /// <returns></returns>
        public ActionResult UpdatePreferedCity(Guid CityGuid)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();

            userDomainLogic.UpdatePreferedCity(CityGuid);
            return(null);
        }
Esempio n. 8
0
        /// <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)));
        }
Esempio n. 9
0
        public ActionResult ChangePassword(string cPw, string nPw)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            var             result          = userDomainLogic.ChangePassword(cPw, nPw, UserVariables.LoggedInUserGuid);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="_city"></param>
        /// <returns></returns>
        public RestaurantSearch GetRestaurantsByCity(City _city)
        {
            RestaurantSearch _restaurantSearch = new RestaurantSearch();

            _restaurantSearch.Restaurants = bringlyEntities.tblRestaurants
                                            .Select(r => new Restaurant
            {
                RestaurantImage = r.RestaurantImage,
                RestaurantGuid  = r.RestaurantGuid,
                RestaurantName  = r.RestaurantName,
                CityGuid        = r.CityGuid,
                CityName        = _city.CityName,
                IsFavorite      = false
            }).ToList();

            if (_city.CityGuid != null)
            {
                _restaurantSearch.Restaurants = _restaurantSearch.Restaurants.Where(s => s.CityGuid == _city.CityGuid).ToList();
            }
            UserDomainLogic   userDomainLogic      = new UserDomainLogic();
            List <Restaurant> favouriteRestaurants = userDomainLogic.FavouriteRestaurants();

            _restaurantSearch.CityGuid = _city.CityGuid;
            _restaurantSearch.CityName = _city.CityName;
            List <Guid> restaurentGuid = favouriteRestaurants.Select(c => c.RestaurantGuid).ToList();

            foreach (Restaurant restaurant in _restaurantSearch.Restaurants)
            {
                if (restaurentGuid.Contains(restaurant.RestaurantGuid))
                {
                    restaurant.IsFavorite = true;
                }
            }
            return(_restaurantSearch);
        }
Esempio n. 11
0
        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"));
        }
Esempio n. 12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ReviewGuid"></param>
        /// <returns></returns>
        public ActionResult AddReview(Guid ReviewGuid)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            var             data            = userDomainLogic.GetReviewByGuid(ReviewGuid);

            ViewBag.PopupTitle = "Add Review for " + data.BusinessName;
            return(PartialView("_AddReview", data));
        }
Esempio n. 13
0
        public ActionResult EditPersonalInformation()
        {
            UserDomainLogic   userDomainLogic   = new UserDomainLogic();
            UserProfile       userProfile       = userDomainLogic.FindUser(UserVariables.LoggedInUserGuid);
            CommonDomainLogic commonDomainLogic = new CommonDomainLogic();

            userProfile.Cities = commonDomainLogic.GetCities();
            return(View(userProfile));
        }
Esempio n. 14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult PersonalInformation()
        {
            UserDomainLogic userProfile = new UserDomainLogic();

            if (TempData["Success"] != null)
            {
                Success(TempData["Success"].ToString());
            }
            return(View(userProfile.FindUser(UserVariables.LoggedInUserGuid)));
        }
Esempio n. 15
0
        public ActionResult DeleteAccount(string password)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            var             result          = userDomainLogic.DeleteAccount(password, UserVariables.LoggedInUserGuid);

            if (result)
            {
                FormsAuthentication.SignOut();
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 16
0
        public ActionResult FindUsertoberegistered(string email, int userRegistrationType, Guid?businessGuid)
        {
            if (businessGuid == null)
            {
                businessGuid = Guid.Empty;
            }
            UserDomainLogic userdomainLogic = new UserDomainLogic();
            var             userProfileData = userdomainLogic.FindUsertoberegistered(email, userRegistrationType, businessGuid);

            return(Json(new { userProfile = userProfileData, isExists = userProfileData.UserGuid == Guid.Empty ? false : true }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 17
0
        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));
        }
Esempio n. 18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reviewguid"></param>
        /// <returns></returns>
        public bool SkipReview(Guid reviewguid)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            MyReview        myReview        = new MyReview();

            myReview.Review     = "";
            myReview.IsSkipped  = true;
            myReview.ReviewGuid = reviewguid;
            myReview            = userDomainLogic.InsertReview(myReview);

            return(true);
        }
Esempio n. 19
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult ManageManagers()
        {
            ManageUserProfiles manageUserProfiles = new ManageUserProfiles();
            UserDomainLogic    userdomainLogic    = new UserDomainLogic();

            if (TempData["Success"] != null)
            {
                Success(TempData["Success"].ToString());
            }
            manageUserProfiles.UserProfiles = userdomainLogic.GetAllUsers();
            return(View(manageUserProfiles));
        }
Esempio n. 20
0
        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"));
        }
Esempio n. 21
0
        /// <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)));
        }
Esempio n. 22
0
        public ActionResult Login(UserLogin userLogin, string returnUrl)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            Message         message         = userDomainLogic.UserLogin(userLogin);

            if (message.MessageType == AdminDomain.Enums.MessageType.Success)
            {
                return(RedirectAfterLogin(returnUrl));
            }
            else
            {
                ErrorBlock(message.MessageText);
                return(View(userLogin));
            }
        }
Esempio n. 23
0
        public ActionResult UserRegistration()
        {
            UserRegistration    userregistration    = new Domain.User.UserRegistration();
            UserDomainLogic     userDomainLogic     = new UserDomainLogic();
            BusinessDomainLogic businessDomainLogic = new BusinessDomainLogic();
            CommonDomainLogic   commonDomainLogic   = new CommonDomainLogic();

            userregistration.Cities = userDomainLogic.GetCities();
            userregistration.Cities.Add(new Domain.City {
                CityGuid = Guid.Empty, CityName = "Other", CityUrlName = "Other"
            });
            userregistration.Countries        = commonDomainLogic.GetCountryList();
            userregistration.BusinessTypeList = businessDomainLogic.GetBusinessTypes();
            return(View(userregistration));
        }
Esempio n. 24
0
        public ActionResult AddReview(MyReview myReview)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();

            if (ModelState.IsValid)
            {
                myReview.IsSkipped = false;
                userDomainLogic.InsertReview(myReview);
                TempData["IspopUp"] = true;
            }

            var data = userDomainLogic.GetReviewByGuid(myReview.ReviewGuid);

            ViewBag.PopupTitle = "Add Review for " + data.BusinessName;

            return(PartialView("_AddReview", data));
        }
Esempio n. 25
0
        public ActionResult DeleteRole(string roleGuid)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            Message         message         = new Message();

            if (userDomainLogic.DeleteRoleLogic(new Guid(roleGuid)))
            {
                ModelState.Clear();
                message.MessageText = "Role has been deleted successfully.";
                message.MessageType = MessageType.Success;
            }
            else
            {
                message.MessageText = "Role deletion failed.";
                message.MessageType = MessageType.Error;
            }
            return(Json(message, JsonRequestBehavior.AllowGet));
        }
Esempio n. 26
0
        /// <summary>
        /// Emaill verification
        /// </summary>
        /// <param name="id">User guid to be verify</param>
        /// <param name="type">User RegistrationType</param>
        /// <returns></returns>
        public ActionResult Verification(string id, int type = 2)
        {
            Guid guid       = Guid.Empty;
            bool isVerified = false;

            if (!string.IsNullOrEmpty(id))
            {
                UserDomainLogic userDomainLogic = new UserDomainLogic();
                Guid.TryParse(id, out guid);

                isVerified = userDomainLogic.VerifyUser(guid);
                if (isVerified)
                {
                    return(View("ThankUConfirmation", guid));
                }
            }

            return(RedirectToAction("verificationexpired", "home"));
        }
Esempio n. 27
0
        public ActionResult Login(UserLogin userLogin, string returnUrl)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            Message         message         = userDomainLogic.UserLoginWithHash(userLogin);

            if (message.MessageType == Domain.Enums.MessageType.NewUser)
            {
                return(RedirectToAction("NewRegistrationfromSocialPage", "User"));
            }
            else if (message.MessageType == Domain.Enums.MessageType.Success)
            {
                return(RedirectAfterLogin(returnUrl));
            }
            else
            {
                ErrorBlock(message.MessageText);
                return(View(userLogin));
            }
        }
Esempio n. 28
0
        public ActionResult EditRole(UserRole role)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            Message         message         = new Message();

            if (userDomainLogic.UpdateRole(role))
            {
                ModelState.Clear();
                role = new UserRole();
                message.MessageText = "Role updated successfully.";
                message.MessageType = MessageType.Success;
            }
            else
            {
                message.MessageText = "Role already exists.";
                message.MessageType = MessageType.Error;
            }
            return(Json(message, JsonRequestBehavior.AllowGet));;
        }
Esempio n. 29
0
        public ActionResult DeleteUser(Guid UserGuid)
        {
            Message         message         = new Message();
            UserDomainLogic userdomainLogic = new UserDomainLogic();

            if (userdomainLogic.DeleteUser(UserGuid))
            {
                ModelState.Clear();
                message.MessageText = "User has been deleted successfully.";
                message.MessageType = MessageType.Success;
            }
            else
            {
                message.MessageText = "User deletion failed.";
                message.MessageType = MessageType.Error;
            }

            return(Json(message, JsonRequestBehavior.AllowGet));
        }
Esempio n. 30
0
        public ActionResult UserRegistration(UserRegistration userRegistration)
        {
            UserDomainLogic userdomainLogic = new UserDomainLogic();

            userRegistration.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"]);
            usrAddress.CityGuid = userRegistration.BillingAddress.CityGuid;

            usrAddress.Country   = userRegistration.BillingAddress.Country;
            usrAddress.Latitude  = userRegistration.BillingAddress.Latitude;
            usrAddress.Longitude = userRegistration.BillingAddress.Longitude;
            usrAddress.PlaceId   = userRegistration.BillingAddress.PlaceId;

            usrAddress.AddressType = Bringly.Domain.Enums.User.UserAddressType.Billing.ToString();
            var cityName = Convert.ToString(HttpContext.Request.Form["BillingAddress.CityName"]);

            if (!string.IsNullOrEmpty(cityName) && usrAddress.CityGuid == Guid.Empty)
            {
                Bringly.Domain.City city = new Domain.City
                {
                    CityGuid    = Guid.NewGuid(),
                    CityName    = cityName,
                    CityUrlName = cityName
                };

                CommonDomainLogic commonDomainLogic = new CommonDomainLogic();
                usrAddress.CityGuid = commonDomainLogic.AddCity(city);
            }

            userRegistration.UserAddresses.Add(usrAddress);
            bool result = userdomainLogic.AddUserProfile(userRegistration);

            if (result)
            {
                return(RedirectToAction("thankregistration", "home"));
            }

            return(RedirectToAction("userregistration", "home"));
        }