Inheritance: System.Web.UI.Page
        public void Can_check_password()
        {
            var reg = new UserRegistration("*****@*****.**", "password");

            Assert.True(reg.PasswordMatches("password"));
            Assert.False(reg.PasswordMatches("wrong"));
        }
Beispiel #2
0
        public ActionResult GetRefererByEmail(string refEmail)
        {
            UserRegistration ur = new UserRegistration();
            var usrDetails = _db.GetUserByEmail(refEmail);
            ur.ID = usrDetails.ID;

            return Json(ur, JsonRequestBehavior.AllowGet);
        }
        public async Task<IdentityResult> RegisterUser(UserRegistration registrationModel)
        {
            User user = new User
            {
                UserName = registrationModel.UserName
            };

            var result = await _userManager.CreateAsync(user, registrationModel.Password);

            return result;
        }   
        public void Service_can_verify_credentials()
        {
            var reg = new UserRegistration("*****@*****.**", "password");
            var store = new Mock<IUserRegistrationStore>();
            store.Setup(x => x.Load("*****@*****.**")).Returns(reg);
            var svc = new UserRegistrationService(store.Object);

            var result = svc.Login("*****@*****.**", "password");

            store.VerifyAll();
            Assert.Equal(reg.Id, result);
        }
        public void Password_is_hashed()
        {
            var store = new UserRegistrationStore();
            var reg = new UserRegistration("*****@*****.**", "password");

            store.Save(reg);

            var stored = store.Users.FirstOrDefault(x => x.Id == reg.Id);

            Assert.NotNull(stored);
            Assert.False(Encoding.UTF8.GetBytes("password").SequenceEqual(stored.Password));
        }
        public void Password_is_saved()
        {
            var store = new UserRegistrationStore();
            var reg = new UserRegistration("*****@*****.**", "password");

            store.Save(reg);

            var stored = store.Users.FirstOrDefault(x => x.Id == reg.Id);

            Assert.NotNull(stored);
            Assert.True(stored.PasswordMatches("password"));
        }
        public void Login_fails_with_wrong_password()
        {
            var reg = new UserRegistration("*****@*****.**", "password");
            var store = new Mock<IUserRegistrationStore>();
            store.Setup(x => x.Load("*****@*****.**")).Returns(reg);
            var svc = new UserRegistrationService(store.Object);

            var result = svc.Login("*****@*****.**", "wrong");

            store.VerifyAll();
            Assert.NotEqual(reg.Id, result);
            Assert.Equal(new Guid(), result);
        }
        public async Task<IHttpActionResult> Register(UserRegistration registrationModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IdentityResult result = await _authRepository.RegisterUser(registrationModel);

            IHttpActionResult errorResult = getErrorResult(result);

            if (errorResult != null)
            {
                return errorResult;
            }

            return Ok();
        }
        public ActionResult Edit(int id)
        {
            var c = (from d in db.CustomerMasters where d.CustomerID == id select d).FirstOrDefault();

            //var c = (from d in db.CustomerMasters join t1 in db.UserRegistrations on d.Email equals t1.EmailId   where d.CustomerID == id select d).FirstOrDefault();

            //(from c in db.CustomerEnquiries join t1 in db.EmployeeMasters on c.CollectedEmpID equals t1.EmployeeID join t2 in db.EmployeeMasters on c.EmployeeID equals t2.EmployeeID select new PickupRequestVM { EnquiryID = c.EnquiryID, EnquiryDate = c.EnquiryDate, Consignor = c.Consignor, Consignee = c.Consignee, eCollectedBy = t1.EmployeeName, eAssignedTo = t2.EmployeeName, AWBNo = c.AWBNo }).ToList();
            CustmorVM obj = new CustmorVM();

            //ViewBag.country = db.CountryMasters.ToList();
            //ViewBag.city = db.CityMasters.ToList().Where(x => x.CountryID == c.CountryID);
            //ViewBag.location = db.LocationMasters.ToList().Where(x => x.CityID == c.CityID);
            ViewBag.currency     = db.CurrencyMasters.ToList();
            ViewBag.employee     = db.EmployeeMasters.ToList();
            ViewBag.businessType = db.BusinessTypes.ToList();
            ViewBag.roles        = db.RoleMasters.ToList();
            int BranchID = Convert.ToInt32(Session["CurrentBranchID"].ToString());
            var data     = db.tblDepots.Where(d => c.BranchID == BranchID).ToList();

            ViewBag.Depot = data;

            if (c == null)
            {
                return(HttpNotFound());
            }
            else
            {
                UserRegistration u = new UserRegistration();
                if (c.UserID != null)
                {
                    //UserRegistration x = (from a in db.UserRegistrations where a.UserName == c.Email select a).FirstOrDefault();
                    UserRegistration x = (from a in db.UserRegistrations where a.UserID == c.UserID select a).FirstOrDefault();

                    if (x != null)
                    {
                        if (x.RoleID != null)
                        {
                            if (obj.RoleID == 0)
                            {
                                obj.RoleID = 13;
                            }
                            else
                            {
                                obj.RoleID = Convert.ToInt32(x.RoleID);
                            }
                        }
                    }
                }
                obj.RoleID     = 13;
                obj.CustomerID = c.CustomerID;

                if (c.AcCompanyID != null)
                {
                    obj.AcCompanyID = c.AcCompanyID.Value;
                }
                else
                {
                    obj.AcCompanyID = Convert.ToInt32(Session["CurrentCompanyID"].ToString());
                }

                obj.CustomerCode = c.CustomerCode;
                obj.CustomerName = c.CustomerName;
                obj.CustomerType = c.CustomerType;

                obj.ReferenceCode = c.ReferenceCode;
                obj.ContactPerson = c.ContactPerson;
                obj.Address1      = c.Address1;
                obj.Address2      = c.Address2;
                obj.Address3      = c.Address3;
                obj.Phone         = c.Phone;
                obj.Mobile        = c.Mobile;
                obj.Fax           = c.Fax;
                obj.Email         = c.Email;
                obj.Website       = c.WebSite;

                if (c.CountryID != null)
                {
                    obj.CountryID = c.CountryID.Value;
                }
                if (c.CityID != null)
                {
                    obj.CityID = c.CityID.Value;
                }
                if (c.LocationID != null)
                {
                    obj.LocationID = c.LocationID.Value;
                }
                obj.CountryName  = c.CountryName;
                obj.LocationName = c.LocationName;
                obj.CityName     = c.CityName;

                if (c.CurrencyID != null)
                {
                    obj.CurrenceyID = c.CurrencyID.Value;
                }
                else
                {
                    obj.CurrenceyID = Convert.ToInt32(Session["CurrencyId"].ToString());
                }

                obj.StatusActive = c.StatusActive.Value;
                if (c.CreditLimit != null)
                {
                    obj.CreditLimit = c.CreditLimit.Value;
                }
                else
                {
                    obj.CreditLimit = 0;
                }
                if (c.StatusTaxable != null)
                {
                    obj.StatusTaxable = c.StatusTaxable.Value;
                }
                else
                {
                    obj.StatusTaxable = false;
                }

                if (c.EmployeeID != null)
                {
                    obj.EmployeeID = c.EmployeeID.Value;
                }
                if (c.statusCommission != null)
                {
                    obj.StatusCommission = c.statusCommission.Value;
                }
                if (c.BusinessTypeId != null)
                {
                    obj.BusinessTypeId = Convert.ToInt32(c.BusinessTypeId);
                }
                if (c.Referal != null)
                {
                    obj.Referal = c.Referal;
                }

                obj.OfficeTimeFrom = c.OfficeOpenTime;
                obj.OfficeTimeTo   = c.OfficeCloseTime;

                if (c.CourierServiceID != null)
                {
                    obj.CourierServiceID = c.CourierServiceID.Value;
                }

                if (c.BranchID != null)
                {
                    obj.BranchID = c.BranchID.Value;
                }
                obj.VATTRN = c.VATTRN;
                int DepotID = Convert.ToInt32(Session["CurrentDepotID"].ToString());
                obj.DepotID          = DepotID;
                obj.CustomerUsername = c.CustomerUsername;
                obj.Password         = c.Password;
                if (c.UserID != null)
                {
                    obj.UserID = c.UserID;
                }

                if (c.ApprovedBy == null || c.ApprovedBy == 0)
                {
                    obj.ApprovedBy       = Convert.ToInt32(Session["UserID"]);
                    obj.ApprovedUserName = Convert.ToString(Session["UserName"]);
                }
            }

            return(View(obj));
        }
Beispiel #10
0
        public async Task <IActionResult> Register(RegisterViewModel viewModel, string returnUrl = null)
        {
            // Persist returnUrl
            ViewData["ReturnUrl"] = returnUrl;

            // Build model for view providers
            var registration = new UserRegistration()
            {
                UserName        = viewModel.UserName,
                Email           = viewModel.Email,
                Password        = viewModel.Password,
                ConfirmPassword = viewModel.ConfirmPassword
            };

            // Validate model state within all involved view providers
            if (await _registerViewProvider.IsModelStateValidAsync(registration, this))
            {
                // Get composed type from all involved view providers
                registration = await _registerViewProvider.ComposeModelAsync(registration, this);

                // Create the user from composed type
                var result = await _platoUserManager.CreateAsync(
                    registration.UserName,
                    registration.Email,
                    registration.Password);

                //var result = await _userManager.CreateAsync(registerViewModel, registerViewModel.Password);
                if (result.Succeeded)
                {
                    // Indicate new flag to allow optional update
                    // on first creation within any involved view provider
                    registration.IsNewUser = true;

                    // Execute ProvideUpdateAsync
                    await _registerViewProvider.ProvideUpdateAsync(registration, this);

                    // Success - Redirect to confirmation page
                    return(RedirectToAction(nameof(RegisterConfirmation)));
                }
                else
                {
                    // Report errors that may have occurred whilst creating the user
                    foreach (var error in result.Errors)
                    {
                        ViewData.ModelState.AddModelError(string.Empty, error.Description);
                    }
                }
            }

            // if we reach this point some view model validation
            // failed within a view provider, display model state errors
            foreach (var modelState in ViewData.ModelState.Values)
            {
                foreach (var error in modelState.Errors)
                {
                    //_alerter.Danger(T[error.ErrorMessage]);
                }
            }

            return(await Register(returnUrl));
        }
Beispiel #11
0
 public UserRegisteredEvent(WorkContext workContext, User user, UserRegistration registration)
 {
     WorkContext      = workContext;
     User             = user;
     UserRegistration = registration;
 }
Beispiel #12
0
 public ActionResult YourAccount(UserRegistration ob)
 {
     return(View());
 }
Beispiel #13
0
        public async Task <ActionResult> Register([FromForm] UserRegistration registration)
        {
            TryValidateModel(registration);

            // This required for populate fields on form on post-back
            WorkContext.Form = Form.FromObject(registration);

            if (ModelState.IsValid)
            {
                // Register user
                var user = registration.ToUser();
                user.Contact = registration.ToContact();
                user.StoreId = WorkContext.CurrentStore.Id;

                var result = await _signInManager.UserManager.CreateAsync(user, registration.Password);

                if (result.Succeeded)
                {
                    user = await _signInManager.UserManager.FindByNameAsync(user.UserName);

                    await _publisher.Publish(new UserRegisteredEvent(WorkContext, user, registration));

                    await _signInManager.SignInAsync(user, isPersistent : true);

                    await _publisher.Publish(new UserLoginEvent(WorkContext, user));

                    // Send new user registration notification
                    var registrationEmailNotification = new RegistrationEmailNotification(WorkContext.CurrentStore.Id, WorkContext.CurrentLanguage)
                    {
                        FirstName = registration.FirstName,
                        LastName  = registration.LastName,
                        Login     = registration.UserName,
                        Sender    = WorkContext.CurrentStore.Email,
                        Recipient = GetUserEmail(user)
                    };
                    await SendNotificationAsync(registrationEmailNotification);

                    if (_options.SendAccountConfirmation)
                    {
                        var token = await _signInManager.UserManager.GenerateEmailConfirmationTokenAsync(user);

                        var callbackUrl = Url.Action("ConfirmEmail", "Account", new { UserId = user.Id, Token = token }, protocol: Request.Scheme, host: WorkContext.CurrentStore.Host);
                        var emailConfirmationNotification = new EmailConfirmationNotification(WorkContext.CurrentStore.Id, WorkContext.CurrentLanguage)
                        {
                            Url       = callbackUrl,
                            Sender    = WorkContext.CurrentStore.Email,
                            Recipient = GetUserEmail(user)
                        };
                        var sendNotifcationResult = await SendNotificationAsync(emailConfirmationNotification);

                        if (sendNotifcationResult.IsSuccess == false)
                        {
                            WorkContext.Form.Errors.Add(SecurityErrorDescriber.ErrorSendNotification(sendNotifcationResult.ErrorMessage));
                            return(View("customers/register", WorkContext));
                        }
                    }

                    return(StoreFrontRedirect("~/account"));
                }
                else
                {
                    foreach (var error in result.Errors)
                    {
                        WorkContext.Form.Errors.Add(new FormError {
                            Code = error.Code?.PascalToKebabCase(), Description = error.Description
                        });
                    }
                }
            }

            return(View("customers/register", WorkContext));
        }
 public int AddFestivalRegistration(UserRegistration content)
 {
     _db.UserRegistrations.Add(content);
     _db.SaveChanges();
     return content.ID;
 }
Beispiel #15
0
 /// <summary>ChkDuplicateUser
 ///
 /// </summary>
 /// <param name="UserEmail"></param>
 /// <param name="UserID"></param>
 /// <param name="QRCID"></param>
 /// <param name="ObjUserRegistration"></param>
 /// <returns></returns>
 public bool CheckDuplicateUser(string userEmail, long userId, out long qrcId, out UserRegistration objUserRegistration)
 {
     try
     {
         qrcId             = 0; objUserRegistration = null;
         ObjUserRepository = new UserRepository();
         var data = ObjUserRepository.GetAll(u => u.UserEmail == userEmail.Trim() && u.UserId != userId && u.IsDeleted == false);
         if (data.Count > 0)
         {
             qrcId = (data[0].QRCID.HasValue) ? (data[0].QRCID.Value) : 0;
             objUserRegistration = data[0];
             return(false);
         }
         return(true);
     }
     catch (Exception)
     { throw; }
 }
Beispiel #16
0
        public ActionResult Edit(EmployeeVM a)
        {
            UserRegistration u       = new UserRegistration();
            PickupRequestDAO _dao    = new PickupRequestDAO();
            int            BranchID  = Convert.ToInt32(Session["CurrentBranchID"].ToString());
            int            companyid = Convert.ToInt32(Session["CurrentCompanyID"].ToString());
            EmployeeMaster v         = new EmployeeMaster();

            v = db.EmployeeMasters.Find(a.EmployeeID);

            v.EmployeeName = a.EmployeeName;
            v.EmployeeCode = a.EmployeeCode;
            v.Address1     = a.Address1;
            v.Address2     = a.Address2;
            v.Address3     = a.Address3;
            v.Phone        = a.Phone;
            //v.Email = a.Email;
            v.Fax           = a.Fax;
            v.Mobile        = a.MobileNo;
            v.CountryName   = a.CountryName;
            v.AcCompanyID   = companyid;
            v.DesignationID = a.DesignationID;


            v.BranchID = BranchID;
            v.DepotID  = a.Depot;
            //if (v.Password!=a.Password)
            //   v.Password = a.Password;
            v.MobileDeviceID   = a.MobileDeviceID;
            v.MobileDevicePwd  = a.MobileDevicePWD;
            v.JoinDate         = a.JoinDate;
            v.StatusCommission = a.StatusCommision;
            v.statusDefault    = a.StatusDefault;
            v.StatusActive     = a.StatusActive;

            UserRegistration x = null;

            if (a.UserID != null && a.UserID > 0)
            {
                x = (from b in db.UserRegistrations where b.UserID == a.UserID select b).FirstOrDefault();
            }

            if (v.Email != a.Email)
            {
                if (x == null)
                {
                    int max1 = (from c1 in db.UserRegistrations orderby c1.UserID descending select c1.UserID).FirstOrDefault();

                    int roleid = db.RoleMasters.Where(t => t.RoleName == "Agent").FirstOrDefault().RoleID;
                    u.UserID   = max1 + 1;
                    u.UserName = a.Email;
                    u.EmailId  = a.Email;
                    if (a.Password == "")
                    {
                        u.Password = _dao.RandomPassword(6);
                    }
                    else
                    {
                        u.Password = a.Password; //  _dao.RandomPassword(6);
                    }
                    u.Phone    = a.Phone;
                    u.IsActive = true;
                    u.RoleID   = roleid;
                    db.UserRegistrations.Add(u);
                    db.SaveChanges();

                    v.Email  = a.Email;
                    a.UserID = u.UserID;
                }
                else
                {
                    //checking duplicate
                    UserRegistration x1 = (from b in db.UserRegistrations where b.UserName == a.Email && b.UserID != a.UserID select b).FirstOrDefault();
                    if (x1 == null)
                    {
                        x.EmailId = a.Email;
                        if (a.Password == "")
                        {
                            x.Password = _dao.RandomPassword(6);
                        }
                        else
                        {
                            x.Password = a.Password; //  _dao.RandomPassword(6);
                        }
                        db.Entry(x).State = EntityState.Modified;
                        db.SaveChanges();
                    }

                    v.Email  = a.Email;
                    a.UserID = x.UserID;
                }
            }
            else
            {
                if (a.UserID == null || a.UserID == 0)
                {
                    int max1 = (from c1 in db.UserRegistrations orderby c1.UserID descending select c1.UserID).FirstOrDefault();

                    int roleid = db.RoleMasters.Where(t => t.RoleName == "Agent").FirstOrDefault().RoleID;
                    u.UserID   = max1 + 1;
                    u.UserName = a.Email;
                    u.EmailId  = a.Email;

                    if (a.Password == "")
                    {
                        u.Password = _dao.RandomPassword(6);
                    }
                    else
                    {
                        u.Password = a.Password; //  _dao.RandomPassword(6);
                    }
                    u.Phone    = a.Phone;
                    u.IsActive = true;
                    u.RoleID   = a.RoleID;
                    db.UserRegistrations.Add(u);
                    db.SaveChanges();

                    v.UserID = u.UserID;
                }
                else
                {
                    u = (from b in db.UserRegistrations where b.UserID == a.UserID select b).FirstOrDefault();
                    if (u.Password != a.Password)
                    {
                        u.Password = a.Password;
                    }

                    if (u.RoleID != a.RoleID)
                    {
                        u.RoleID = a.RoleID;
                    }
                    if (u.Password == null)
                    {
                        u.Password = "******";
                    }
                    db.Entry(u).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }



            db.Entry(v).State = EntityState.Modified;
            db.SaveChanges();
            TempData["SuccessMsg"] = "You have successfully Update Employee.";
            return(RedirectToAction("Index"));
        }
    private void doFacebookConnect()
    {
        StateManager stateManager = StateManager.Instance;
        SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
        if (objSessionvalue == null)
        {
            messageText.Text = "Your Tribute session had expired. Please log in.";
            refreshPage.Text = Request.QueryString["source"].ToString().Equals("headerLogin")
                ? "false" : "true";
        }
        else
        {
            UserRegistration objUserReg = new UserRegistration();
            TributesPortal.BusinessEntities.Users objUsers = new TributesPortal.BusinessEntities.Users();
            objUsers.UserId = objSessionvalue.UserId;
            objUsers.FacebookUid = _FacebookUid;
            objUserReg.Users = objUsers;

            UserInfoManager umgr = new UserInfoManager();
            umgr.UpdateFacebookAssociation(objUserReg);
            StringBuilder sbr = new StringBuilder();
            if (objUserReg.CustomError != null)
            {

                var fbwc = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
                var me = (IDictionary<string, object>)fbwc.Get("me");
                string fbName = (string)me["first_name"] + " " + (string)me["last_name"];

                sbr.Append(string.Format("<div class=\"yt-Error\"><h3>Sorry, {0}.</h3>", fbName));
                sbr.Append(string.Format(
                    "The Facebook account named {0} is aleady used by some other Your Tribute Account.",
                    fbName));
                sbr.Append("Would you like to:");
                sbr.Append("<ul>");
                sbr.Append("<li><a href=\"#\" onclick=\"fb_logout(); return false;\">");
                sbr.Append("   <img id=\"fb_logout_image\" ");
                sbr.Append("src=\"http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif\"");
                sbr.Append(" alt=\"Logout from Facebook and Your Tribute\"/></a> of both Your Tribute and Facebook Connect ");
                sbr.Append("and switch to the other account using your Facebook email address and password.</li>");
                sbr.Append("<li><a href=\"#\" onclick=\"fb_err_logout(); return false;\">");
                sbr.Append("<img id=\"fb_logout_image\" ");
                sbr.Append("src=\"http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif\"");
                sbr.Append(" alt=\"Disconnect from Facebook\"/></a> of Facebook Connect and try again.</li>");
                sbr.Append("<li><a href=\"javascript:void(0);\" onclick=\"OpenContactUS();\">Contact us</a> to discuss the situation further if you are confused.</li>");
                sbr.Append("</div>");

                messageText.Text = sbr.ToString();
                refreshPage.Text = "false";
            }
            else
            {
                if(Request.QueryString["source"].ToString().Equals("headerLogin"))
                {
                  refreshPage.Text = "true";
                } else {
                    messageText.Text = "<div class=\"yt-Notice\">Facebook Connection was added to your account.</div>";
                    refreshPage.Text = "false";
                }
            }
        }
    }
 public UserRegistration GetRegistrationByEmail(string email)
 {
     UserRegistration ur = new UserRegistration();
     ur = _db.UserRegistrations.FirstOrDefault(d => d.Email == email);
     return ur;
 }
Beispiel #19
0
        public ActionResult Login(LoginModel loginModel)
        {
            var serialization    = new Serialization();
            var userRegistration = new UserRegistration();
            var loginBA          = new Login();
            var HashCriteria     = new Hashtable();
            var actualCriteria   = string.Empty;

            if (ModelState.IsValid)
            {
                HashCriteria.Add("UserName", loginModel.UserName);
                actualCriteria = serialization.SerializeBinary((object)HashCriteria);
                var result            = loginBA.ValidateLogin(actualCriteria);
                var loginModelDetails = (LoginModel)(serialization.DeSerializeBinary(Convert.ToString(result)));

                var validateResult  = false;
                var isValidPassword = false;
                if (loginModelDetails.common != null)
                {
                    isValidPassword = SessionManagement.CipherTool.Verify(loginModel.Password, Convert.ToString(loginModelDetails.common.Password));
                }

                if (isValidPassword)
                {
                    if (loginModelDetails.common.IsEnabled == false)
                    {
                        ModelState.AddModelError("", "User account is disabled, Please contact Administrator.");
                        return(PartialView("_Login", loginModel));
                    }

                    //initialize userAuthModel
                    var userSession = Authenticate(loginModelDetails);

                    //
                    if (userSession != null)
                    {
                        var identity = new ClaimsIdentity(AuthenticationHelper.CreateClaim(userSession,
                                                                                           userSession.UserRole),
                                                          DefaultAuthenticationTypes.ApplicationCookie
                                                          );
                        AuthenticationManager.SignIn(new AuthenticationProperties()
                        {
                            AllowRefresh = true,
                            IsPersistent = true,
                            ExpiresUtc   = DateTime.UtcNow.AddHours(1)
                        }, identity);
                    }

                    SessionController.UserSession.UserId       = loginModelDetails.common.UserId;
                    SessionController.UserSession.UserName     = loginModelDetails.common.UserName;
                    SessionController.UserSession.EmailAddress = loginModelDetails.common.EmailAddress;
                    SessionController.UserSession.RoleType     = loginModelDetails.common.RoleType;
                    validateResult = true;

                    //Reteive the subscription for the user to check if this is valid or not
                    HashCriteria   = new Hashtable();
                    actualCriteria = string.Empty;
                    List <UserProfileEditModel> objUserProfileDetails = new List <UserProfileEditModel>();
                    HashCriteria.Add("UserID", loginModelDetails.common.UserId);
                    actualCriteria = serialization.SerializeBinary((object)HashCriteria);
                    var resultuser = userRegistration.GetUserSpecificDetails(actualCriteria);
                    objUserProfileDetails = (List <UserProfileEditModel>)(serialization.DeSerializeBinary(Convert.ToString(resultuser)));
                    var UserProfileDetails = objUserProfileDetails.FirstOrDefault();

                    //To get the customer credit card information for this user
                    if (UserProfileDetails.CustomerID != "" && UserProfileDetails.CustomerID != null)
                    {
                        string customerID = UserProfileDetails.CustomerID;
                        SessionController.UserSession.CustomerID = customerID;

                        var            customerService = new StripeCustomerService();
                        StripeCustomer stripeCustomer  = customerService.Get(customerID);

                        //Check if user has any subscription or not
                        if (stripeCustomer.Subscriptions.TotalCount > 0)
                        {
                            var subscriptionID = stripeCustomer.Subscriptions.Data[0].Id;

                            var subscriptionService = new StripeSubscriptionService();
                            StripeSubscription stripeSubscription = subscriptionService.Get(subscriptionID);

                            //Check if the user subscription is on or not: If on then Paid else Unpaid
                            if (stripeSubscription.Status == "active")
                            {
                                SessionController.UserSession.IsPaid = true;
                            }
                            else
                            {
                                SessionController.UserSession.IsPaid = false;
                            }
                        }
                        else
                        {
                            SessionController.UserSession.IsPaid = false;
                        }
                    }
                    else
                    {
                        SessionController.UserSession.IsPaid = false;
                    }
                }

                if (validateResult)
                {
                    var url = new
                    {
                        Url  = Request.Url.AbsoluteUri,
                        type = "Url"
                    };
                    return(Json(url, JsonRequestBehavior.AllowGet));
                }
            }
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
            return(PartialView("_Login", loginModel));
        }
    /// <summary>
    /// When Admin Login to Change the User Settings
    /// </summary>
    public void OnAdminLogin()
    {
        GenralUserInfo _objGenralUserInfo = new GenralUserInfo();
        UserInfo objUserInfo = new UserInfo();
        UserRegistration _objUserReg = new UserRegistration();

        objUserInfo.UserID = Convert.ToInt32(Request["id"].ToString());

        this._presenter.GetUserCompleteDetail(objUserInfo.UserID);
    }
Beispiel #21
0
        public void SendActivationEmail(int id, string mailTo)
        {
            UniqueCode usrCode = new UniqueCode();
            usrCode = _db.GetCodeByUserID(id);
            string usrUniqueCode = usrCode.ActivationCode;
            UserRegistration uName = new UserRegistration();
            uName = _db.GetRegistrationById(id);
            string userName = uName.FirstName;

            string body = string.Empty;
            using (StreamReader reader = new StreamReader(Server.MapPath("~/Email/WelcomeEmailTemplate.html")))
            {
                body = reader.ReadToEnd();
            }
            body = body.Replace("{RegisteredUSR}", userName);
            body = body.Replace("{UserCode}", usrUniqueCode);

            this.SendFormattedEmail(mailTo, body);
        }
Beispiel #22
0
        public ActionResult Registration(UserRegistration regoModel)
        {
            int userId = this._db.AddFestivalRegistration(regoModel);
            UserRegistration newUser = new UserRegistration();
            //int userId = _db.GetLastInsertValue();
            newUser = _db.GetRegistrationById(userId);

            string usrMail = newUser.Email;

            if (userId != 0)
            {
                this.AddActivationCode(userId);
                this.SendActivationEmail(userId, usrMail);

                if (newUser.Search.StartsWith("?via="))
                {
                    string via = newUser.Search.Substring(5);
                    UserRegistration referrer = _db.GetRegistrationByEmail(via);
                    _db.RewardUser(referrer, newUser, Server.MapPath("~"));
                }

                return Json(new { success = "Registered Success and mail sent" });
            }
            else
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

            return RedirectToAction("Index");
        }
        public UserRegistration GetUserByEmail(string festUserEmail)
        {
            UserRegistration festivalUser = new UserRegistration();
            festivalUser =  (from m in _db.UserRegistrations
                             where m.Email.Equals(festUserEmail)
                             select m).Single();

            return festivalUser;
        }
 public UserRegistration GetRegistrationById(int id)
 {
     UserRegistration ur = new UserRegistration();
     ur = _db.UserRegistrations.FirstOrDefault(d => d.ID == id);
     return ur;
 }
Beispiel #25
0
        public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope accessLevel, ref bool propertyNotFound)
        {
            var outputFormat = string.Empty;

            if (format == string.Empty)
            {
                outputFormat = "g";
            }
            var lowerPropertyName = propertyName.ToLowerInvariant();

            if (accessLevel == Scope.NoSettings)
            {
                propertyNotFound = true;
                return(PropertyAccess.ContentLocked);
            }
            propertyNotFound = true;
            var result   = string.Empty;
            var isPublic = true;

            switch (lowerPropertyName)
            {
            case "url":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(PortalAlias.HTTPAlias, format);
                break;

            case "fullurl":     //return portal alias with protocol
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Globals.AddHTTP(PortalAlias.HTTPAlias), format);
                break;

            case "passwordreminderurl":     //if regsiter page defined in portal settings, then get that page url, otherwise return home page.
                propertyNotFound = false;
                var reminderUrl = Globals.AddHTTP(PortalAlias.HTTPAlias);
                if (RegisterTabId > Null.NullInteger)
                {
                    reminderUrl = Globals.RegisterURL(string.Empty, string.Empty);
                }
                result = PropertyAccess.FormatString(reminderUrl, format);
                break;

            case "portalid":
                propertyNotFound = false;
                result           = (PortalId.ToString(outputFormat, formatProvider));
                break;

            case "portalname":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(PortalName, format);
                break;

            case "homedirectory":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(HomeDirectory, format);
                break;

            case "homedirectorymappath":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(HomeDirectoryMapPath, format);
                break;

            case "logofile":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(LogoFile, format);
                break;

            case "footertext":
                propertyNotFound = false;
                var footerText = FooterText.Replace("[year]", DateTime.Now.Year.ToString());
                result = PropertyAccess.FormatString(footerText, format);
                break;

            case "expirydate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ExpiryDate.ToString(outputFormat, formatProvider));
                break;

            case "userregistration":
                isPublic         = false;
                propertyNotFound = false;
                result           = (UserRegistration.ToString(outputFormat, formatProvider));
                break;

            case "banneradvertising":
                isPublic         = false;
                propertyNotFound = false;
                result           = (BannerAdvertising.ToString(outputFormat, formatProvider));
                break;

            case "currency":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Currency, format);
                break;

            case "administratorid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (AdministratorId.ToString(outputFormat, formatProvider));
                break;

            case "email":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Email, format);
                break;

            case "hostfee":
                isPublic         = false;
                propertyNotFound = false;
                result           = (HostFee.ToString(outputFormat, formatProvider));
                break;

            case "hostspace":
                isPublic         = false;
                propertyNotFound = false;
                result           = (HostSpace.ToString(outputFormat, formatProvider));
                break;

            case "pagequota":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PageQuota.ToString(outputFormat, formatProvider));
                break;

            case "userquota":
                isPublic         = false;
                propertyNotFound = false;
                result           = (UserQuota.ToString(outputFormat, formatProvider));
                break;

            case "administratorroleid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (AdministratorRoleId.ToString(outputFormat, formatProvider));
                break;

            case "administratorrolename":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(AdministratorRoleName, format);
                break;

            case "registeredroleid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (RegisteredRoleId.ToString(outputFormat, formatProvider));
                break;

            case "registeredrolename":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(RegisteredRoleName, format);
                break;

            case "description":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Description, format);
                break;

            case "keywords":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(KeyWords, format);
                break;

            case "backgroundfile":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(BackgroundFile, format);
                break;

            case "admintabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = AdminTabId.ToString(outputFormat, formatProvider);
                break;

            case "supertabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = SuperTabId.ToString(outputFormat, formatProvider);
                break;

            case "splashtabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = SplashTabId.ToString(outputFormat, formatProvider);
                break;

            case "hometabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = HomeTabId.ToString(outputFormat, formatProvider);
                break;

            case "logintabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = LoginTabId.ToString(outputFormat, formatProvider);
                break;

            case "registertabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = RegisterTabId.ToString(outputFormat, formatProvider);
                break;

            case "usertabid":
                isPublic         = false;
                propertyNotFound = false;
                result           = UserTabId.ToString(outputFormat, formatProvider);
                break;

            case "defaultlanguage":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(DefaultLanguage, format);
                break;

            case "users":
                isPublic         = false;
                propertyNotFound = false;
                result           = Users.ToString(outputFormat, formatProvider);
                break;

            case "pages":
                isPublic         = false;
                propertyNotFound = false;
                result           = Pages.ToString(outputFormat, formatProvider);
                break;

            case "contentvisible":
                isPublic = false;
                break;

            case "controlpanelvisible":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.Boolean2LocalizedYesNo(ControlPanelVisible, formatProvider);
                break;
            }
            if (!isPublic && accessLevel != Scope.Debug)
            {
                propertyNotFound = true;
                result           = PropertyAccess.ContentLocked;
            }
            return(result);
        }
        public void UserRegistration_is_saved()
        {
            var store = new UserRegistrationStore();
            var reg = new UserRegistration("*****@*****.**", "password");

            store.Save(reg);

            var stored = store.Users.FirstOrDefault(x => x.Id == reg.Id);

            Assert.NotNull(stored);
            Assert.Equal("*****@*****.**", reg.Email);
        }
 public SubStateRegisterUserBLL(UserRegistration usrRegObj) : base(usrRegObj)
 {
     SubStateRegionId = usrRegObj.UserRegionalAccessProfile.RegionId;
 }
 public void Save(UserRegistration newReg)
 {
     Users.Add(newReg);
     SaveChanges();
 }
    protected void doFacebookSignup()
    {
        var fbwc = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
        var me = (IDictionary<string, object>)fbwc.Get("me");
        string fbName = (string)me["first_name"] + " " + (string)me["last_name"];
        string UserName = fbName.ToLower().Replace(" ", "_").Replace("'", "");/*+
            "_"+_FacebookUid.ToString()*/

        string fql = "Select current_location,pic_square,email from user where uid = " + (string)me["id"];
        JsonArray me2 = (JsonArray)fbwc.Query(fql);
        var mm = (IDictionary<string, object>)me2[0];

        Nullable<int> state = null;
        Nullable<int> country = null;
        string _UserImage = "images/bg_ProfilePhoto.gif";

        if (!string.IsNullOrEmpty((string)mm["pic_square"]))
        {
            _UserImage = (string)mm["pic_square"]; // get user image
        }
        string city = "";
        JsonObject hl = (JsonObject)mm["current_location"];
        if ((string)hl[0] != null)
        {
            city = (string)hl[0];
            UserManager usrmngr = new UserManager();
            object[] param = { (string)hl[2],(string)hl[1] };
            if (usrmngr.GetstateIdByName(param) > 0)
            {
                state = usrmngr.GetstateIdByName(param);
            }
            if (usrmngr.GetCountryIdByName((string)hl[2]) > 0)
            {
                country = usrmngr.GetCountryIdByName((string)hl[2]);
            }

        }

        string password_ = string.Empty;
        string email_ = string.Empty;  //user.proxied_email;
        string result = (string)mm["email"];
        if (!string.IsNullOrEmpty(result))
        {
            email_ = result;
            password_ = RandomPassword.Generate(8, 10);
            password_ = TributePortalSecurity.Security.EncryptSymmetric(password_);

        }
        UserRegistration objUserReg = new UserRegistration();
        TributesPortal.BusinessEntities.Users objUsers =
            new TributesPortal.BusinessEntities.Users(
             UserName, password_,
             (string)me["first_name"], (string)me["last_name"], email_,
             "", false,
             city, state, country, 1, _FacebookUid);
        objUsers.UserImage = _UserImage;
        objUserReg.Users = objUsers;

        /*System.Decimal identity = (System.Decimal)*/
        UserInfoManager umgr = new UserInfoManager();
        umgr.SavePersonalAccount(objUserReg);

        if (objUserReg.CustomError != null)
        {
            messageText.Text=string.Format("<h2>Sorry, {0}.</h2>" +
                "<h3>Those Facebook credentials are already used in some other Your Tribute Account</h3>",
                fbName);
        }
        else
        {
            SessionValue _objSessionValue = new SessionValue(objUserReg.Users.UserId,
                                                             objUserReg.Users.UserName,
                                                             objUserReg.Users.FirstName,
                                                             objUserReg.Users.LastName,
                                                             objUserReg.Users.Email,
                                                             objUserReg.UserBusiness == null ? 1 : 2,
                                                             "Basic",
                                                             objUserReg.Users.IsUsernameVisiable);
            TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance;
            stateManager.Add("objSessionvalue", _objSessionValue, TributesPortal.Utilities.StateManager.State.Session);

            SaveSessionInDB();
            Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", Session.SessionID));
            Response.Cookies["ASP.NET_SessionId"].Domain = "." + WebConfig.TopLevelDomain;

            showDialog.Text = "false";
            refreshPage.Text = "true";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
        {
            topNavigationYM.Visible = true;
            topNavigationYT.Visible = false;
        }

        var fbWebContext = FacebookWebContext.Current;        // get facebook session
        StateManager stateManager = StateManager.Instance;
        SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
        if (!Equals(objSessionvalue, null) && !_section.Equals(HeaderSecionEnum.registration.ToString()))
        {
            spanLogout.InnerHtml = "<a class='logoutLink' id='header_logout' href='Logout.aspx?session=Logout'>Log out</a>";
            int intUserType = objSessionvalue.UserType;
            if (intUserType == 1)
            {
                _userName = objSessionvalue.FirstName;
                lnCreditCount.Visible = false;

            }
            else if (intUserType == 2)
            {
                _userName = objSessionvalue.UserName;
                double NetCreditPoints;
                UserRegistration _objUserReg = new UserRegistration();
                Users objUsers = new Users();
                objUsers.UserId = objSessionvalue.UserId;
                _objUserReg.Users = objUsers;
                object[] param = { _objUserReg };
                BillingResource objBillingResource = new BillingResource();
                objBillingResource.GetCreditPointCount(param);
                UserRegistration objDetails = (UserRegistration)param[0];
                if (objDetails.CreditPointTransaction == null)
                {
                    NetCreditPoints = 0;
                }
                else
                {
                    NetCreditPoints = objDetails.CreditPointTransaction.NetCreditPoints;
                }
                //lbtnCreditCount.Text = "Credits (" + NetCreditPoints.ToString() + ")";
                lnCreditCount.InnerHtml = "Credits (" + NetCreditPoints.ToString() + ")";

            }
            // Added by Ashu on Oct 3, 2011 for rewrite URL
            if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "moments.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "moments.aspx";
            else
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";

            divProfile.Visible = true;
            //spanSignUp.Visible = false;
        }
        else if (!_section.Equals(HeaderSecionEnum.inner.ToString()))
        {
            StringBuilder sbl = new StringBuilder();

            sbl.Append("<a class='yt-horizontalSpacer' href='");
                sbl.Append("log_in.aspx");
            sbl.Append("' >Log in</a>");
            spanLogout.InnerHtml = sbl.ToString();
            divProfile.Visible = false;
        }
        if (fbWebContext.Session == null && objSessionvalue != null)
        {
            StringBuilder sbl = new StringBuilder();
            sbl.Append("<fb:login-button size=\"small\"");
            sbl.Append("\" onlogin=\"doAjaxLogin();\" v=\"2\"><fb:intl>");
            sbl.Append((Equals(objSessionvalue, null) ? "Log in with Facebook" : "Connect"));
            sbl.Append("</fb:intl></fb:login-button>");
            sbl.Append(spanLogout.InnerHtml);

            spanLogout.InnerHtml = sbl.ToString();
        }

        HomeNavValue = "non-current";
        TourNavValue = "non-current";
        FeaturesNavValue = "non-current";
        ExamplesNavValue = "non-current";
        PricingNavValue = "non-current";

        switch (NavigationName)
        {
            case "Home":
                HomeNavValue = "current";
                break;
            case "Tour":
                TourNavValue = "current";
                break;
            case "Features":
                FeaturesNavValue = "current";
                break;
            case "Examples":
                ExamplesNavValue = "current";
                break;
            case "Pricing":
                PricingNavValue = "current";
                break;
            default:
                break;
        }
        //Added to get home url and titleof logo
        string x = HomeUrl();
        x = LogoTitle();
    }
        public void RewardUser(UserRegistration referrer, UserRegistration referee, string root)
        {
            var mailMessage = new SendGridMessage();
            mailMessage.AddTo(referrer.Email);
            mailMessage.From = new MailAddress("*****@*****.**");
            mailMessage.Subject = "A friend you've referred has registered!";

            string body = string.Empty;
            using (StreamReader reader = new StreamReader(String.Format(@"{0}/Email/RewardReferrerEmailTemplate.html", root)))
            {
                body = reader.ReadToEnd();
            }
            body = body.Replace("{referrer}", referrer.FirstName);
            body = body.Replace("{referee}", referee.FirstName);

            mailMessage.Html = body;

            var UserName = ConfigurationManager.AppSettings["mailAccount"];
            var Password = ConfigurationManager.AppSettings["mailPassword"];
            var Credentials = new NetworkCredential(UserName, Password);

            var transportWeb = new Web(Credentials);
            transportWeb.DeliverAsync(mailMessage);
        }
 public void AddToUserRegistrations(UserRegistration userRegistration)
 {
     base.AddObject("UserRegistrations", userRegistration);
 }
Beispiel #33
0
        ///// <summary>ChkDuplicateVehicle
        /////
        ///// </summary>
        ///// <param name="RegistrationNo"></param>
        ///// <param name="VehicleID"></param>
        ///// <param name="ObjVehicleMaster"></param>
        ///// <returns></returns>
        //public bool ChkDuplicateVehicle(string RegistrationNo, long VehicleID, out VehicleMaster ObjVehicleMaster)
        //{
        //    try
        //    {
        //        ObjVehicleMaster = null;
        //        ObjVehicleRepository = new VehicleRepository();
        //        var data = ObjVehicleRepository.GetAll(v => v.RegistrationNo == RegistrationNo.Trim() && v.VehicleID != VehicleID);
        //        if (data.Count > 0)
        //        {
        //            ObjVehicleMaster = data[0];
        //            return false;
        //        }
        //        return true;
        //    }
        //    catch (Exception)
        //    { throw; }
        //}

        /// <summary>UpdateUser
        ///
        /// </summary>
        /// <param name="objUserModel"></param>
        /// <param name="QRCID"></param>
        /// <param name="IsEmployeeRegistration"></param>
        public void UpdateUser(UserModel objUserModel, out long qrcId, bool isEmployeeRegistration, out UserRegistration user)
        {
            ObjUserRepository = new UserRepository();
            user  = null;
            user  = ObjUserRepository.GetSingleOrDefault(u => u.UserId == objUserModel.UserId && u.IsDeleted == false);
            qrcId = (user.QRCID.HasValue) ? user.QRCID.Value : 0;
            if (user != null)
            {
                user.FirstName      = objUserModel.FirstName;
                user.LastName       = objUserModel.LastName;
                user.DOB            = Convert.ToDateTime(objUserModel.DOB);
                user.BloodGroup     = objUserModel.BloodGroup;
                user.AlternateEmail = objUserModel.AlternateEmail;
                user.Gender         = objUserModel.Gender;
                if (isEmployeeRegistration)
                {
                    user.Password = objUserModel.Password;
                }
                user.IsEmailVerify = objUserModel.IsEmailVerify;
                user.IsLoginActive = objUserModel.IsLoginActive;
                user.Gender        = objUserModel.Gender;
                if (!string.IsNullOrEmpty(objUserModel.ProfileImage.FileName))
                {
                    user.ProfileImage = objUserModel.ProfileImage.FileName;
                }
                ObjUserRepository.Update(user);
            }
        }
 public static UserRegistration CreateUserRegistration(string userName, string fullName)
 {
     UserRegistration userRegistration = new UserRegistration();
     userRegistration.UserName = userName;
     userRegistration.FullName = fullName;
     return userRegistration;
 }
        public DisclaimerViewModel(UserRegistration userRegistration)
        {
            this.UserRegistration = userRegistration;
            this.GoToPersonalDataProtectionCmd = new GoToPersonalDataProtectionCommand(this);

            var strBuilder = new StringBuilder();

            strBuilder.Append("<!DOCTYPE html>")
            .Append("<html>")
            .Append("<head>")
            .Append("<meta charset=utf-8 />")
            .Append("<meta name=\"viewport\" content=\"width = device - width, initial - scale = 1.0\">")
            .Append("<title>©2017 Call Aladdin Disclaimer</title>")
            .Append("</head>")
            .Append("<body style=\"background-color: #EAECF5\">")
            .Append("<div style=\"background-color: lightgray; padding: 10px; text-align:justify\">")

            .Append("<h3><u>TERMS AND CONDITIONS</u></h3>")
            .Append(" <p>Call Aladdin is a marketplace platform for services performed by its users. The following terms and conditions govern your access to and use of the Call Aladdin website or mobile app, including any content, functionality and services offered on or through [website URL(“thewebsite”) or mobile app name]. Please read the terms and conditions carefully before you start to use the website or mobile app. By using the website or mobile app, you agree to follow and be bound by these terms and conditions in full. If you disagree with these terms and conditions or any part of these terms and conditions, you should not use this website or mobile app.")
            .Append("</p><br/>")

            .Append("<h3><u>DEFINITIONS</u></h3>")
            .Append("<p>“Contractor(s)” are users who offer services through our website or mobile app. “Client(s)” are users who procure the services offered by the Contractors through our website or mobile app.")
            .Append("</p><br/>")

            .Append("<h3><u>OVERVIEW</u></h3>")
            .Append("<p>Only registered users may offer or procure services on our website or mobile app.")
            .Append("</p><br/>")

            .Append("<h3><u>DISCLAIMER</u></h3>")
            .Append("We reserve the right to modify the terms and conditions and to add new or additional terms or conditions on your use of our website or mobile app at any time and at our sole discretion.Such modifications and additional terms and conditions will be effective immediately without notice to you.Your continued use of this website or mobile app will be deemed acceptance thereof. We also reserve the right to terminate your usage of our website or mobile app at any time and at our sole discretion without notice to you.")
            .Append("The information contained in this website or mobile app is for general information purposes only and is not legal advice or other professional advice.While we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or mobile app or the information, products, services, or related graphics contained on the website or mobile app for any purpose. Any reliance you place on such information is therefore strictly at your own risk.")
            .Append("Nothing on this website or mobile app should be taken to constitute professional advice or formal recommendations and we exclude all representations and warranties relating to the content and use of this website or mobile app.")
            .Append("While the content of this website or mobile app is provided in good faith, we do not warrant that the information will be kept up to date, be true and not misleading, or that this website or mobile app will always(or ever) be available for use.Every effort is made to keep the website or mobile app up and running smoothly.However, we take no responsibility for, and will not be liable for, the website or mobile app being temporarily unavailable due to technical issues beyond our control.")
            .Append("  We do not warrant that the servers that make this website or mobile app available will be error, virus or bug free and you accept that it is your responsibility to make adequate provision for protection against such threats.")
            .Append(" Our website or mobile app makes no express or implied warranty for merchantability, fitness for a particular purpose or otherwise or all other warranties expressed or implied including the warranty of merchantability and the warranty of fitness for a particular purpose are expressly excluded or disclaimed.")
            .Append(" </p><br/>")

            .Append("<h3><u>DISPUTE</u></h3>")
            .Append("<p><b>Our company is a technology company that does not provide or engage in the services")
            .Append(" provided by the Contractors and our company is not a Contractor providing services to Clients.The website or mobile app are intended to be used for facilitating the Contractors to offer their services to the Clients.Our company is not responsible or liable for the acts and / or omissions of any services provided by the Contractors to the Clients, for the acts and / or omissions of payment by the Clients to the Contractors and for any criminal and / or illegal action committed by the Contractors or the Clients.The Contractors shall, at all time, not claim or cause any person to misunderstand that the Contractors are the agent, employee or staff of our company, and the services provided by the Contractors are not, in any way, be deemed as services of our company.")
            .Append(" Furthermore, we are not responsible for the content, quality or the level of service provided by the Contractors.We provide no warranty with respect to the services provided by the Contractors, their delivery, and any communications between Clients and the Contractors.We encourage Clients to take advantage of our rating system, our community and common sense in choosing appropriate service offers.We encourage Clients and Contractors to try and settle conflicts amongst themselves.")
            .Append(" </b></p><br/>")

            .Append(" <h3><u>LIMITATION OF LIABILITY</u></h3>")
            .Append("<p>In no event will we be liable for any incidental, indirect, consequential or special damage of")
            .Append(" any kind, or any damages whatsoever, including, without limitation, those resulting from loss of profit, loss of contracts, goodwill, data, information, income, anticipated savings or business relationships, whether or not advised of the possibility of such damage, arising out of or in connection with the use of this website or mobile app or any linked websites or mobile apps.")
            .Append("</p><br/>")

            .Append("<h3><u>LINKS</u></h3>")
            .Append("<p>This website or mobile app may include links providing direct access to other websites or")
            .Append(" internet resources. We have no control over the nature, content and availability of those websites or internet resources.These links are included for convenience, and the inclusion of any link does not necessarily imply a recommendation or endorse the views expressed within them.We are also not responsible for the accuracy or content of information contained in these websites or internet resources.")
            .Append("  </p><br/>")

            .Append("  <h3><u>USERS</u></h3>")
            .Append(" <p>You may view, download for caching purposes only, and print pages (or other content) from the website or mobile app for your own personal use, but you must not:-")
            .Append(" <ol type=\"i\">")
            .Append(" <li>Republish material from this website or mobile app (including republication on another website);</li>")
            .Append("<li>Sell, rent or sub-licence material from the website or mobile app;</li>")
            .Append("<li>Reproduce, duplicate, copy or otherwise exploit material on our website or mobile app for a commercial purpose;</li>")
            .Append("<li>Edit or otherwise modify any material on the website or mobile app; or</li>")
            .Append("<li>Redistribute material from this website or mobile app.</li>")
            .Append("</ol>")
            .Append("  You must not use our website or mobile app in any way that causes, or may cause damage to the website or impairment of the availability or accessibility of the website, or in any way which is unlawful, illegal, fraudulent or harmful or in connection with any unlawful, illegal, fraudulent or harmful purpose or activity.In case of any violation of the terms and conditions, we reserve the right to seek all remedies available to it in law and in equity.We reserve the right, at our sole discretion and at any time, to terminate your access to the website, mobile app and / or any of its services without notice to you and without liability to you or any third party.")
            .Append("   </p><br/>")

            .Append(" <h3><u>INDEMNITY</u></h3>")
            .Append("<p>By using this website or mobile app, you agree that you shall defend, indemnify and hold our")
            .Append(" company, its licensors and each such party’s parent organizations, subsidiaries, affiliates, officers, directors, members, employees, attorneys and agents harmless from and against any and all claims, costs, damages, losses, liabilities and expenses(including attorneys’ fees and costs) arising out of or in connection with: (a)your violation or breach of any term of this Agreement or any applicable law or regulation, including any local laws or ordinances, whether or not referenced herein; (b)your violation of any rights of any third party, including, but not limited to the Contractors or Clients, as a result of your own interaction with any third party; and(c) your use(or misuse) of the website or mobile app. You agree that you shall not sue or recover any damages from us as a result of our decision to remove or refuse to process any information or content, to warn you, to suspend or terminate your access to our website or mobile app.")
            .Append("</p><br/>")

            .Append(" <h3><u>ENTIRE AGREEMENT</u></h3>")
            .Append(" <p>These terms and conditions constitute the entire agreement between you and us in relation to")
            .Append(" your use of our website or mobile app and any disputes relating to these terms and conditions will be subject to the relevant governing law.")
            .Append("</p><br/>")

            .Append("</div>")
            .Append("</body>")
            .Append("</html>");

            this.DisclaimerText = strBuilder.ToString();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["TokenId"] != null)
            _tokenId = Request.QueryString["TokenId"].ToString();
        else
        {
            //Response.Redirect("log_in.aspx");
            Response.Redirect(Redirect.RedirectToPage(Redirect.PageList.Inner2LoginPage.ToString()));
        }
        lblMessage.Text = "Video tribute already exists for the selected tribute.";
        lblYes.Text = "Do you want to replace the existing video tribute with the new one?";

        if (!this.IsPostBack)
        {
            lblPhotoTributeYearlyCost.Text = WebConfig.PhotoOneyearAmount;
            lblPhotoTributeLifeTimeCost.Text = WebConfig.PhotoLifeTimeAmount;
            lblTributeYearlyCost.Text = WebConfig.TributeOneyearAmount;
            lblTributeLifeTimeCost.Text = WebConfig.TributeLifeTimeAmount;

            this._presenter.GetTokenDetails();
            this._presenter.GetUserDetails();
            GetSessionValues();
            SetControlVisibility();
            _presenter.GetTributesList();
            StateManager stateManager = StateManager.Instance;
            SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
            if (!Equals(objSessionvalue, null) && !_section.Equals(HeaderSecionEnum.registration.ToString()))
            {
                spanLogout.InnerHtml = "<a class='logoutLink' id='header_logout' href='Logout.aspx'>Log out</a>";
                int intUserType = objSessionvalue.UserType;
                if (intUserType == 1)
                {
                    // _userName = objSessionvalue.FirstName + " " + objSessionvalue.LastName;
                    _userName = objSessionvalue.FirstName;
                }
                else if (intUserType == 2)
                {
                    _validityText = "30";
                    _userName = objSessionvalue.UserName;
                    double NetCreditPoints;
                    UserRegistration _objUserReg = new UserRegistration();
                    Users objUsers = new Users();
                    objUsers.UserId = objSessionvalue.UserId;
                    _objUserReg.Users = objUsers;
                    object[] param = { _objUserReg };
                    BillingResource objBillingResource = new BillingResource();
                    objBillingResource.GetCreditPointCount(param);
                    UserRegistration objDetails = (UserRegistration)param[0];
                    if (objDetails.CreditPointTransaction == null)
                    {
                        NetCreditPoints = 0;
                    }
                    else
                    {
                        NetCreditPoints = objDetails.CreditPointTransaction.NetCreditPoints;
                    }
                    //lbtnCreditCount.Text = "Credits (" + NetCreditPoints.ToString() + ")";
                    lnCreditCount.InnerHtml = "Credits (" + NetCreditPoints.ToString() + ")";

                }
                // Added by Ashu on Oct 3, 2011 for rewrite URL
                if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                    myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "moments.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "moments.aspx";
                else
                    myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";

                divProfile.Visible = true;
                //spanSignUp.Visible = false;
            }
            else if (!_section.Equals(HeaderSecionEnum.inner.ToString()))
            {
                StringBuilder sbl = new StringBuilder();

                sbl.Append("<a class='yt-horizontalSpacer' href='");
                if (_section.Equals(HeaderSecionEnum.home.ToString()))
                {
                    sbl.Append("log_in.aspx");
                }
                else
                {
                    sbl.Append("javascript: void(0);' onclick='UserLoginModalpopupFromSubDomain(location.href,document.title);");
                }
                sbl.Append("'>Log in</a>");

                //spanSignUp.Visible = !(_section.Equals(HeaderSecionEnum.registration.ToString()));
                spanLogout.InnerHtml = sbl.ToString();
                divProfile.Visible = false;
            }
            //LHK:(1:44 PM 2/2/2011) To show price in credits to a Business User
            if (objSessionvalue.UserType == 2)
            {
                lblPhotoTributeYearlyCost.Text = WebConfig.PhotoYearlyCreditCost;
                lblPhotoTributeLifeTimeCost.Text = WebConfig.PhotoLifeTimeCreditCost;
                lblTributeYearlyCost.Text = WebConfig.TributeYearlyCreditCost;
                lblTributeLifeTimeCost.Text = WebConfig.TributeLifeTimeCreditCost;
            }
        }
        //added to handle the session issue on selection of a tribute from the tribute list
        Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", Session.SessionID));
        GetSessionValues();
    }
Beispiel #37
0
        public async Task <ActionResult> ExternalLoginCallback(string returnUrl)
        {
            var loginInfo = await _signInManager.GetExternalLoginInfoAsync();

            if (loginInfo == null)
            {
                return(View("customers/login", WorkContext));
            }

            User user;

            // Sign in the user with this external login provider if the user already has a login.
            var externalLoginResult = await _signInManager.ExternalLoginSignInAsync(loginInfo.LoginProvider, loginInfo.ProviderKey, isPersistent : false, bypassTwoFactor : true);

            if (!externalLoginResult.Succeeded)
            {
                // TODO: Locked out not work. Need to add some API methods to support lockout data.
                if (externalLoginResult.IsLockedOut)
                {
                    return(View("lockedout", WorkContext));
                }

                IdentityResult identityResult;

                var currentUser = WorkContext.CurrentUser;
                if (currentUser.IsRegisteredUser)
                {
                    identityResult = await _signInManager.UserManager.AddLoginAsync(currentUser, loginInfo);
                }
                else
                {
                    user = new User
                    {
                        Email    = loginInfo.Principal.FindFirstValue(ClaimTypes.Email),
                        UserName = $"{loginInfo.LoginProvider}--{loginInfo.ProviderKey}",
                        StoreId  = WorkContext.CurrentStore.Id,
                    };

                    user.ExternalLogins.Add(new ExternalUserLoginInfo {
                        ProviderKey = loginInfo.ProviderKey, LoginProvider = loginInfo.LoginProvider
                    });

                    var userRegistration = new UserRegistration
                    {
                        FirstName = loginInfo.Principal.FindFirstValue(_firstNameClaims, "unknown"),
                        LastName  = loginInfo.Principal.FindFirstValue(ClaimTypes.Surname),
                        UserName  = user.UserName,
                        Email     = user.Email
                    };
                    user.Contact = userRegistration.ToContact();

                    identityResult = await _signInManager.UserManager.CreateAsync(user);

                    if (identityResult.Succeeded)
                    {
                        await _publisher.Publish(new UserRegisteredEvent(WorkContext, user, userRegistration));
                    }
                }

                if (!identityResult.Succeeded)
                {
                    WorkContext.Form.Errors.AddRange(identityResult.Errors.Select(x => new FormError {
                        Code = x.Code.PascalToKebabCase(), Description = x.Description
                    }));
                    return(View("customers/login", WorkContext));
                }
            }

            user = await _signInManager.UserManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey);

            if (!externalLoginResult.Succeeded)
            {
                await _signInManager.SignInAsync(user, isPersistent : false);
            }
            await _publisher.Publish(new UserLoginEvent(WorkContext, user));

            return(StoreFrontRedirect(returnUrl));
        }
    protected void lbtnFacebookSignup_Click(object sender, EventArgs e)
    {
        var fbWebContext = FacebookWebContext.Current;
        if (FacebookWebContext.Current.Session != null)
        {
            var fbwc = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
            var me = (IDictionary<string, object>)fbwc.Get("me");
            _FacebookUid = fbWebContext.UserId;
            try
            {
                string fbName = (string)me["first_name"] + " " + (string)me["last_name"];

                string UserName = fbName.ToLower().Replace(" ", "_").Replace("'", "");/*+
                    "_"+_FacebookUid.ToString()*/

                Nullable<int> state = null;
                Nullable<int> country = null;
                string _UserImage = "images/bg_ProfilePhoto.gif";
                //if (!string.IsNullOrEmpty(user.pic_square))
                string fql = "Select current_location,pic_square,email from user where uid = " + fbWebContext.UserId;
                JsonArray me2 = (JsonArray)fbwc.Query(fql);
                var mm = (IDictionary<string, object>)me2[0];

                if (!string.IsNullOrEmpty((string)mm["pic_square"]))
                {
                    _UserImage = (string)mm["pic_square"]; // get user image
                }

                string city = "";
                if ((JsonObject)mm["current_location"] != null)
                {
                    JsonObject hl = (JsonObject)mm["current_location"];
                    city = (string)hl[0];

                    if (_presenter.GetFacebookStateId((string)hl[2], (string)hl[1]) > 0)
                    {
                        state = _presenter.GetFacebookStateId((string)hl[2], (string)hl[1]);
                    }
                    if (_presenter.GetFacebookCountryId((string)hl[2]) > 0)
                    {
                        country = _presenter.GetFacebookCountryId((string)hl[2]);
                    }

                }

                string password_ = string.Empty;
                _FBEmail = string.Empty;  //user.proxied_email;

                string result = (string)mm["email"];
                if (!string.IsNullOrEmpty(result))
                {

                    _FBEmail = result;
                    password_ = RandomPassword.Generate(8, 10);
                    password_ = TributePortalSecurity.Security.EncryptSymmetric(password_);

                }

                int _email = _presenter.EmailAvailable();
                if (_email == 0)
                {

                    UserRegistration objUserReg = new UserRegistration();
                    TributesPortal.BusinessEntities.Users objUsers =
                        new TributesPortal.BusinessEntities.Users(
                         UserName, password_,
                         (string)me["first_name"], (string)me["last_name"], _FBEmail,
                         "", false,
                         city, state, country, 1, _FacebookUid, ApplicationType);
                    objUsers.UserImage = _UserImage;
                    // objUsers.ApplicationType = ApplicationType;
                    objUserReg.Users = objUsers;

                    /*System.Decimal identity = (System.Decimal)*/
                    _presenter.DoShortFacebookSignup(objUserReg);

                    if (objUserReg.CustomError != null)
                    {
                        ShowMessage(string.Format("<h2>Sorry, {0}.</h2>" +
                            "<h3>Those Facebook credentials are already used in some other Your Tribute Account</h3>", fbName), "", true);
                    }
                    else
                    {
                        SessionValue _objSessionValue = new SessionValue(objUserReg.Users.UserId,
                                                                         objUserReg.Users.UserName,
                                                                         objUserReg.Users.FirstName,
                                                                         objUserReg.Users.LastName,
                                                                         objUserReg.Users.Email,
                                                                         objUserReg.UserBusiness == null ? 1 : 2,
                                                                         "Basic",
                                                                         objUserReg.Users.IsUsernameVisiable);
                        TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance;
                        stateManager.Add("objSessionvalue", _objSessionValue, TributesPortal.Utilities.StateManager.State.Session);

                        SaveSessionInDB();
                        Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", Session.SessionID));
                        Response.Cookies["ASP.NET_SessionId"].Domain = "." + WebConfig.TopLevelDomain;
                        RedirectPage();
                        return;
                    }
                }
                else
                {
                    ShowMessage(headertext, "User already exists for this email: " + _FBEmail, true);//COMDIFFRES: is this message correct?
                    _showSignUpDialog = "false";
                }

            }
            catch (Exception ex)
            {
                ShowMessage(headertext, ex.Message, true);
                _showSignUpDialog = "false";
                // killFacebookCookies();
                // ShowMessage("Your Facebook session has timed out. Please logout and try again");
            }

        }
    }
Beispiel #39
0
        public void Register(UserRegistration userRegistrationParams)
        {
            if (RegistrationSettings.UsersCanRegister)
            {
                var policyAnswers = new List <PolicyForUserViewModel>();
                if (_utilsServices.FeatureIsEnabled("Laser.Orchard.Policy") &&
                    UserRegistrationExtensionsSettings.IncludePendingPolicy == Policy.IncludePendingPolicyOptions.Yes)
                {
                    IEnumerable <PolicyTextInfoPart> policies = GetUserLinkedPolicies(userRegistrationParams.Culture);
                    // controllo che tutte le policy abbiano una risposta e che le policy obbligatorie siano accettate
                    var allRight = true;
                    foreach (var policy in policies)
                    {
                        var policyId       = policy.Id;
                        var policyRequired = policy.UserHaveToAccept;
                        var answer         = userRegistrationParams.PolicyAnswers.Where(w => w.PolicyId == policyId).SingleOrDefault();
                        if (answer != null)
                        {
                            if (!answer.PolicyAnswer && policyRequired)
                            {
                                allRight = false;
                            }
                        }
                        else if (answer == null && policyRequired)
                        {
                            allRight = false;
                        }
                        if (answer != null)
                        {
                            policyAnswers.Add(new PolicyForUserViewModel {
                                OldAccepted  = false,
                                PolicyTextId = policyId,
                                Accepted     = answer.PolicyAnswer,
                                AnswerDate   = DateTime.Now
                            });
                        }
                    }
                    if (!allRight)
                    {
                        throw new SecurityException(T("User has to accept policies!").Text);
                    }
                }
                var registrationErrors = new List <string>();
                if (ValidateRegistration(userRegistrationParams.Username, userRegistrationParams.Email,
                                         userRegistrationParams.Password, userRegistrationParams.ConfirmPassword, out registrationErrors))
                {
                    var createdUser = _membershipService.CreateUser(new CreateUserParams(
                                                                        userRegistrationParams.Username,
                                                                        userRegistrationParams.Password,
                                                                        userRegistrationParams.Email,
                                                                        userRegistrationParams.PasswordQuestion,
                                                                        userRegistrationParams.PasswordAnswer,
                                                                        (RegistrationSettings.UsersAreModerated == false) && (RegistrationSettings.UsersMustValidateEmail == false),
                                                                        false
                                                                        ));
                    // _membershipService.CreateUser may return null and tell nothing about why it failed to create the user
                    // if the Creating user event handlers set the flag to cancel user creation.
                    if (createdUser == null)
                    {
                        throw new SecurityException(T("User registration failed.").Text);
                    }
                    // here user was created
                    var favCulture = createdUser.As <FavoriteCulturePart>();
                    if (favCulture != null)
                    {
                        var culture = _commonsServices.ListCultures().SingleOrDefault(x => x.Culture.Equals(userRegistrationParams.Culture));
                        if (culture != null)
                        {
                            favCulture.Culture_Id = culture.Id;
                        }
                        else
                        {
                            // usa la culture di default del sito
                            favCulture.Culture_Id = _cultureManager.GetCultureByName(_cultureManager.GetSiteCulture()).Id;
                        }
                    }
                    if ((RegistrationSettings.UsersAreModerated == false) && (RegistrationSettings.UsersMustValidateEmail == false))
                    {
                        _userEventHandler.LoggingIn(userRegistrationParams.Username, userRegistrationParams.Password);
                        _authenticationService.SignIn(createdUser, userRegistrationParams.CreatePersistentCookie);
                        // solleva l'evento LoggedIn sull'utente
                        _userEventHandler.LoggedIn(createdUser);
                    }

                    // [HS] BEGIN: Whe have to save the PoliciesAnswers cookie and persist answers on the DB after Login/SignIn events because during Login/Signin events database is not updated yet and those events override cookie in an unconsistent way.
                    if (_utilsServices.FeatureIsEnabled("Laser.Orchard.Policy") && UserRegistrationExtensionsSettings.IncludePendingPolicy == Policy.IncludePendingPolicyOptions.Yes)
                    {
                        _policyServices.PolicyForUserMassiveUpdate(policyAnswers, createdUser);
                    }
                    // [HS] END

                    if (RegistrationSettings.UsersMustValidateEmail)
                    {
                        // send challenge e-mail
                        var siteUrl = _orchardServices.WorkContext.CurrentSite.BaseUrl;
                        if (string.IsNullOrWhiteSpace(siteUrl))
                        {
                            siteUrl = HttpContext.Current.Request.ToRootUrlString();
                        }
                        UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
                        _userService.SendChallengeEmail(createdUser, nonce => urlHelper.MakeAbsolute(urlHelper.Action("ChallengeEmail", "Account", new { Area = "Orchard.Users", nonce = nonce }), siteUrl));
                    }
                }
                else
                {
                    throw new SecurityException(String.Join(", ", registrationErrors));
                }
            }
            else
            {
                throw new SecurityException(T("User cannot register due to Site settings").Text);
            }
        }
Beispiel #40
0
 public void editUser(int id, UserRegistration m)
 {
     _userRepository.editUser(id, m);
 }
Beispiel #41
0
        /// <summary>
        /// Called when an Admin needs to create a new User account for the persons Jurisdiction.
        /// </summary>
        /// <param name="profileObj">UserProfile</param>
        /// <param name="OldUserId">int?</param>
        /// <param name="IsRegistrationRequest">bool</param>
        /// <param name="RequestedAgencyId">int</param>
        /// <param name="CreatedBy">int?</param>
        /// <returns>bool</returns>
        /// <returns>out int? UserId</returns>
        //private static bool CreateUser(UserRegistration regObj, bool IsRegistrationRequest, int? CreatedBy, out int? UserId)
        //{
        //    regObj.Password = GetEncryptedPassword(regObj.Password);
        //    return UserDAL.CreateUser(regObj, IsRegistrationRequest, CreatedBy, out UserId);
        //}


        /// <summary>
        ///     Requests for ErrorMessage by both Old SHIPtalk Users who login with old accounts
        ///     as well as Anonymous requests for User account.
        /// </summary>
        /// <param name="profileObj">UserProfile</param>
        /// <param name="OldUserId">int?</param>
        /// <param name="RequestedAgencyId">int</param>
        /// <returns>bool</returns>
        /// <returns>out int? UserId</returns>
        public static bool RegisterUser(UserRegistration regObj, out int?UserId)
        {
            regObj.Password = GetEncryptedPassword(regObj.Password);
            return(UserDAL.CreateUser(regObj, out UserId));
        }
Beispiel #42
0
 public bool isExisting(UserRegistration m, string username)
 {
     return(_userRepository.isExisting(m, username));
 }
        public ActionResult ApproveCustomer(int id)
        {
            var       c   = (from d in db.CustomerMasters where d.CustomerID == id select d).FirstOrDefault();
            CustmorVM obj = new CustmorVM();


            if (c == null)
            {
                return(HttpNotFound());
            }
            else
            {
                UserRegistration u = new UserRegistration();
                if (c.UserID != null)
                {
                    //UserRegistration x = (from a in db.UserRegistrations where a.UserName == c.Email select a).FirstOrDefault();
                    UserRegistration x = (from a in db.UserRegistrations where a.UserID == c.UserID select a).FirstOrDefault();

                    if (x != null)
                    {
                        if (x.RoleID != null)
                        {
                            if (obj.RoleID == 0)
                            {
                                obj.RoleID = 13;
                            }
                            else
                            {
                                obj.RoleID = Convert.ToInt32(x.RoleID);
                            }
                        }
                    }
                }
                obj.RoleID     = 13;
                obj.CustomerID = c.CustomerID;

                if (c.AcCompanyID != null)
                {
                    obj.AcCompanyID = c.AcCompanyID.Value;
                }
                else
                {
                    obj.AcCompanyID = Convert.ToInt32(Session["CurrentCompanyID"].ToString());
                }

                obj.CustomerCode = c.CustomerCode;
                obj.CustomerName = c.CustomerName;
                obj.CustomerType = c.CustomerType;

                obj.ReferenceCode = c.ReferenceCode;
                obj.ContactPerson = c.ContactPerson;
                obj.Address1      = c.Address1;
                obj.Address2      = c.Address2;
                obj.Address3      = c.Address3;
                obj.Phone         = c.Phone;
                obj.Mobile        = c.Mobile;
                obj.Fax           = c.Fax;
                obj.Email         = c.Email;
                obj.Website       = c.WebSite;
                //obj.CountryID = c.CountryID; //.Value;
                //obj.CityID = c.CityID; //.Value;
                //obj.LocationID = c.LocationID; //.Value;
                obj.CountryName  = c.CountryName;
                obj.LocationName = c.LocationName;
                obj.CityName     = c.CityName;

                if (c.CurrencyID != null)
                {
                    obj.CurrenceyID = c.CurrencyID.Value;
                }
                else
                {
                    obj.CurrenceyID = Convert.ToInt32(Session["CurrencyId"].ToString());
                }

                obj.StatusActive = c.StatusActive.Value;
                if (c.CreditLimit != null)
                {
                    obj.CreditLimit = c.CreditLimit.Value;
                }
                else
                {
                    obj.CreditLimit = 0;
                }

                obj.StatusTaxable = c.StatusTaxable.Value;

                if (c.EmployeeID != null)
                {
                    obj.EmployeeID = c.EmployeeID.Value;
                }
                if (c.statusCommission != null)
                {
                    obj.StatusCommission = c.statusCommission.Value;
                }
                if (c.BusinessTypeId != null)
                {
                    obj.BusinessTypeId = Convert.ToInt32(c.BusinessTypeId);
                }
                if (c.Referal != null)
                {
                    obj.Referal = c.Referal;
                }

                obj.OfficeTimeFrom = c.OfficeOpenTime;
                obj.OfficeTimeTo   = c.OfficeCloseTime;

                if (c.CourierServiceID != null)
                {
                    obj.CourierServiceID = c.CourierServiceID.Value;
                }

                if (c.BranchID != null)
                {
                    obj.BranchID = c.BranchID.Value;
                }

                int DepotID = Convert.ToInt32(Session["CurrentDepotID"].ToString());
                obj.DepotID          = DepotID;
                obj.CustomerUsername = c.CustomerUsername;
                if (c.UserID != null)
                {
                    obj.UserID = c.UserID;
                }
                obj.ApprovedBy       = Convert.ToInt32(Session["UserID"]);
                obj.ApprovedUserName = Convert.ToString(Session["UserName"]);
                obj.ApprovedOn       = DateTime.Now;
            }

            return(View(obj));
        }
Beispiel #44
0
        public ViewResult Register(UserRegistration userRegistration)
        {
            var errors = userRegistration.Validate();

            if (errors == null)
            {
                IList <UserFlavor> userFlavors = Session["UserFlavorSelected"] as List <UserFlavor>;
                IList <EventType>  eventTypes  = Session["EventTypeSelected"] as List <EventType>;
                IList <Garment>    mygarments  = Session["MyGarments"] as List <Garment>;
                IList <Garment>    mywishlist  = Session["MyWishList"] as List <Garment>;

                PublicUser user = new PublicUser();
                user.EmailAddress = userRegistration.Email;
                user.ChangeZipCode(userRegistration.ZipCode);
                user.SetFlavors(userFlavors);
                user.Size = new UserSize(Convert.ToInt32(userRegistration.UserSize));

                //TODO: Get the UserId from ASP.NET Membership
                MembershipCreateStatus status;
                MembershipUser         mu = Membership.CreateUser(userRegistration.UserName, userRegistration.Password, userRegistration.Email, securityQuestionRepository.Get(Convert.ToInt32(userRegistration.SecurityQuestion)).Description, userRegistration.SecurityAnswer, true, out status);
                if (status != MembershipCreateStatus.Success)
                {
                    errors = new ErrorSummary();
                    errors.RegisterErrorMessage("MembershipUser", status.ToString());
                    return(RegistrationError(userRegistration, errors.ErrorMessages));
                }
                user.MembershipUserId = Convert.ToInt32(mu.ProviderUserKey);
                user.FirstName        = string.Empty;
                user.LastName         = string.Empty;
                user.PhoneNumber      = string.Empty;

                if (eventTypes != null)
                {
                    foreach (EventType eventType in eventTypes)
                    {
                        user.AddEventType(eventType);
                    }
                }

                registeredUserRepository.SaveOrUpdate(user);
                Closet closet = new Closet();
                closet.User         = user;
                closet.PrivacyLevel = PrivacyLevel.Private;

                closetRepository.SaveOrUpdate(closet);
                if (mygarments != null)
                {
                    foreach (Garment garment in mygarments)
                    {
                        closet.AddGarment(garment);
                    }
                    closetRepository.SaveOrUpdate(closet);
                }
                user.Closet = closet;

                registeredUserRepository.SaveOrUpdate(user);

                if (mywishlist != null && mywishlist.Count > 0)
                {
                    WishList wl = new WishList();
                    wl.User = user;
                    foreach (Garment wishlist in mywishlist)
                    {
                        wl.AddGarment(wishlist);
                    }
                    wishListRepository.SaveOrUpdate(wl);
                }
                closetRepository.GenerateCloset(user);

                Session.Abandon();
                Session["UserRegistration"] = mu;
                return(View("RegistrationFinish", userRegistration));
            }

            return(RegistrationError(userRegistration, errors.ErrorMessages));
        }
 public ContentResult RegisterSsl(UserRegistration userRegistrationParams)
 {
     return(RegisterLogic(userRegistrationParams));
 }
Beispiel #46
0
 private ViewResult RegistrationError(UserRegistration userRegistration, string[] result)
 {
     ViewData["Errors"] = result;
     GetRegistrationInfo();
     return(View("Registration", userRegistration));
 }
Beispiel #47
0
        public ActionResult Create(EmployeeVM v)
        {
            int BranchID          = Convert.ToInt32(Session["CurrentBranchID"].ToString());
            int companyid         = Convert.ToInt32(Session["CurrentCompanyID"].ToString());
            PickupRequestDAO _dao = new PickupRequestDAO();
            //if (ModelState.IsValid)
            //{
            EmployeeMaster a   = new EmployeeMaster();
            int            max = (from c in db.EmployeeMasters orderby c.EmployeeID descending select c.EmployeeID).FirstOrDefault();

            a.EmployeeID   = max + 1;
            a.EmployeeName = v.EmployeeName;
            a.EmployeeCode = "";// v.EmployeeCode;
            a.Address1     = v.Address1;
            a.Address2     = v.Address2;
            a.Address3     = v.Address3;
            a.Phone        = v.Phone;

            a.Fax         = v.Fax;
            a.Email       = v.Email;
            a.Mobile      = v.MobileNo;
            a.AcCompanyID = companyid;

            a.CountryName = v.CountryName;
            a.CityName    = v.CityName;

            a.DesignationID    = v.DesignationID;
            a.JoinDate         = Convert.ToDateTime(v.JoinDate);
            a.BranchID         = BranchID;
            a.DepotID          = v.Depot;
            a.Password         = v.Password;
            a.MobileDeviceID   = v.MobileDeviceID;
            a.MobileDevicePwd  = v.MobileDevicePWD;
            a.StatusCommission = v.StatusCommision;
            a.statusDefault    = v.StatusDefault;
            a.StatusActive     = v.StatusActive;
            a.Type             = "E";

            UserRegistration u = new UserRegistration();

            UserRegistration x = (from b in db.UserRegistrations where b.UserName == v.Email select b).FirstOrDefault();

            if (x == null)
            {
                int max1 = (from c1 in db.UserRegistrations orderby c1.UserID descending select c1.UserID).FirstOrDefault();
                u.UserID   = max + 1;
                u.UserName = v.Email;
                u.EmailId  = v.Email;
                u.Password = v.Password;
                u.Phone    = v.Phone;
                u.IsActive = true;
                u.RoleID   = v.RoleID;
                db.UserRegistrations.Add(u);
                db.SaveChanges();
            }

            a.UserID = u.UserID;

            db.EmployeeMasters.Add(a);
            db.SaveChanges();
            ReceiptDAO.ReSaveEmployeeCode();


            TempData["SuccessMsg"] = "You have successfully added Employee.";
            return(RedirectToAction("Index"));
            //}
        }
Beispiel #48
0
 public bool Post([FromBody] UserRegistration credentials)
 {
     return(userAuthenticationService.RegisterUser(credentials));
 }
 public async Task AddAsync(UserRegistration userRegistration)
 {
     await _userAccessContext.AddAsync(userRegistration);
 }
        public string GetPassword()
        {
            string           id  = string.Empty;
            DataAccess       obj = new DataAccess();
            UserRegistration ob  = new UserRegistration();

            ob.EmailId = txtUserName.Text;
            DataTable     dt  = obj.SelectDataByEmailId(ob);
            StringBuilder pwd = new StringBuilder();

            if (dt != null && dt.Rows.Count > 0)
            {
                id = dt.Rows[0]["PK_UserID"].ToString();
                Session["Name"] = dt.Rows[0]["UserName"].ToString();
                Session["Id"]   = id.ToString();
                Session["CSP1"] = dt.Rows[0]["CSP1"].ToString();
                Session["CSP2"] = dt.Rows[0]["CSP2"].ToString();

                int[] serverid = { Convert.ToInt32(dt.Rows[0]["CSP1"].ToString()), Convert.ToInt32(dt.Rows[0]["CSP2"].ToString()) };


                bool resultstatus = false;
                try
                {
                    DataAccess  obj1 = new DataAccess();
                    CloudMaster ob1  = new CloudMaster();
                    for (int j = 0; j < serverid.Length; j++)
                    {
                        ob1.Id = Convert.ToInt32(serverid[j].ToString());
                        DataTable dt11 = obj1.SelectCloudById(ob1);
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            string CloudId           = dt11.Rows[0]["Id"].ToString();
                            string CloudName         = dt11.Rows[0]["CloudName"].ToString();
                            string CloudDBServerName = dt11.Rows[0]["CloudDBServerName"].ToString();
                            string CloudDBUserName   = dt11.Rows[0]["CloudDBUserName"].ToString();
                            string CloudDBPassword   = dt11.Rows[0]["CloudDBPassword"].ToString();

                            string ConnectionString = "User Id = " + CloudDBUserName + "; Password = "******";Initial Catalog= " + CloudName + "; Data Source=" + CloudDBServerName;

                            SqlConnection con = new SqlConnection(ConnectionString);
                            con.Open();
                            string        sqlquery = "select * from tbl_Users where RefId = " + id;
                            SqlCommand    cmd      = new SqlCommand(sqlquery, con);
                            SqlDataReader buf      = cmd.ExecuteReader();
                            if (buf.Read())
                            {
                                resultstatus = true;
                                pwd.Append(buf["Pwd"].ToString());
                            }
                            buf.Close();
                            con.Close();
                        }
                    }
                }
                catch (Exception er)
                {
                    return("");
                }

                //string orginialpwd = GetData(pwd.ToString());
            }
            else
            {
                lblres.Text = "Invalid UserName";
            }

            return(pwd.ToString());
        }
Beispiel #51
0
        public int EditUser(UserRegistration UR)
        {
            int query = Convert.ToInt32(Context1.SP_EditUserDetails(UR.UserID, UR.UserName, UR.Password));

            return(query);
        }
Beispiel #52
0
        /// <summary>
        /// 登陆验证  BLL
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="pwd"> 密码</param>
        /// <returns> int类型</returns>
        public int BLL_select_UserRegistration(UserRegistration tion)
        {
            int a = new DAL_BolgLogin().DAL_Login_UserRegistration(tion);

            return(a);
        }
    private void doFacebookDisconnect()
    {
        StateManager stateManager = StateManager.Instance;
        SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
        StringBuilder sbr = new StringBuilder();
        if (objSessionvalue == null)
        {
            messageText.Text = "Your Tribute session had expired. Please log in.";
            refreshPage.Text = Request.QueryString["source"].ToString().Equals("headerLogin")
               ? "false" : "true";
        }
        else
        {
            UserRegistration objUserReg = new UserRegistration();
            TributesPortal.BusinessEntities.Users objUsers = new TributesPortal.BusinessEntities.Users();
            objUsers.UserId = objSessionvalue.UserId;
            objUserReg.Users = objUsers;

            UserInfoManager umgr = new UserInfoManager();
            umgr.RemoveFacebookAssociation(objUserReg);
            HttpContext.Current.Session.Clear();
            if (string.IsNullOrEmpty(objSessionvalue.UserEmail))
            {
                sbr.Append("<div class=\"yt-Error\"><h3>Urgent: You must <a href=\"");
                sbr.Append(Session["APP_BASE_DOMAIN"].ToString());
                sbr.Append("adminprofileemailpassword.aspx\">set up an email address and password</a>!</h3>");
                sbr.Append("Your account was disconnected from Facebook, but you do not have an ");
                sbr.Append("email address and password on file. If you do not create a password ");
                sbr.Append("then you will not be able to login later.</div>");
                messageText.Text = sbr.ToString();
            }
            else
            {
                messageText.Text = "<div class=\"yt-Notice\">Facebook was disconnected from your account.</div>";
            }
        }
    }
    private bool CheckAvailablity()
    {
        bool avability = false;
        UserRegistration objUserReg = new UserRegistration();
        if(string.IsNullOrEmpty(txtUsername.Text))
        {
            txtUsername.Text = GenerateUserName(txtFirstName.Text, txtLastName.Text);
        }
        Users objuser = new Users(txtUsername.Text);
        objuser.ApplicationType = this.ApplicationType;
        objUserReg.Users = objuser;
        this._presenter.UserAvailability(objUserReg);
        if (UserIsAvailable != "0")
        {
            Imgability.Attributes.Add("class", "availabilityNotice-Unavailable");
            Imgability.InnerHtml = "Unavailable";
            txtUsername.Text = "";
            avability = true;
            lblErrMsg.InnerHtml = ShowMessage(headertext, ResourceText.GetString("MsgErrNotAvailable_UR"), 1);
            lblErrMsg.Visible = true;

        }
        else
        {
            Imgability.Attributes.Add("class", "availabilityNotice-Available");
            Imgability.InnerHtml = "Available!";
            lblErrMsg.InnerHtml = "";
            lblErrMsg.Visible = false;
        }
        return avability;
    }
Beispiel #55
0
 private static UserRegistration ConvertLinetoEntity(string currentLine)
 {
     string[] lineParts = currentLine.Split(',');
     UserRegistration result = new UserRegistration();
     foreach (FileColumn col in ValidFileColumns)
     {
         switch (col.Name)
         {
             case UserRegistrationUploadFileColumns.IdentificationNumber:
                 result.IdentificationNumber = lineParts[col.Sequence].ToString();
                 break;
             case UserRegistrationUploadFileColumns.LastName:
                 result.LastName = lineParts[col.Sequence].ToString();
                 break;
             case UserRegistrationUploadFileColumns.FirstName:
                 result.FirstName = lineParts[col.Sequence].ToString();
                 break;
             case UserRegistrationUploadFileColumns.Email:
                 result.Email = lineParts[col.Sequence].ToString();
                 break;
             default:
                 // we don't care about the rest of the columns provided.
                 break;
         }
     }
     return result;
 }
Beispiel #56
0
        public string SaveUser(UserRegistration model)
        {
            string result = cwApi.WebApiAccess(model, "SaveUser", "Register").Result;

            return(result);
        }
Beispiel #57
0
 /// <summary>
 ///   BLL 获取用户的ID  和  是 用户类型  1 表示普通用户,0表示管理员
 /// </summary>
 /// <param name="tion">UserRegistration tion</param>
 /// <returns>返回list 集合  获取用户类型  1 表示普通用户,0表示管理员</returns>
 public List <UserRegistration> BLL__select_userID_UserRegistration(UserRegistration tion)
 {
     return(new DAL_BolgLogin().DAL_select_userID_UserRegistration(tion));
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(UserControl_TributeHeader));
        var fbWebContext = FacebookWebContext.Current.Session;

         StateManager stateManager = StateManager.Instance;
        SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
        if (!Equals(objSessionvalue, null) && !_section.Equals(HeaderSecionEnum.registration.ToString()))
        {
            spanLogout.InnerHtml = "<a id='header_logout' style='cursor:pointer; text-decoration:underline;' onclick='javascript:LogOut();'>Log out</a>";
            int intUserType = objSessionvalue.UserType;
            if (intUserType == 1)
            {
                // _userName = objSessionvalue.FirstName + " " + objSessionvalue.LastName;
                _userName = objSessionvalue.FirstName;
                lnCreditCount.Visible = false;
            }
            else if (intUserType == 2)
            {
                _userName = objSessionvalue.UserName;
                double NetCreditPoints;
                UserRegistration _objUserReg = new UserRegistration();
                Users objUsers = new Users();
                objUsers.UserId = objSessionvalue.UserId;
                _objUserReg.Users = objUsers;
                object[] param = { _objUserReg };
                BillingResource objBillingResource = new BillingResource();
                objBillingResource.GetCreditPointCount(param);
                UserRegistration objDetails = (UserRegistration)param[0];
                if (objDetails.CreditPointTransaction == null)
                {
                    NetCreditPoints = 0;
                }
                else
                {
                    NetCreditPoints = objDetails.CreditPointTransaction.NetCreditPoints;
                }
                //lbtnCreditCount.Text = "Credits (" + NetCreditPoints.ToString() + ")";
                lnCreditCount.InnerHtml = "Credits (" + NetCreditPoints.ToString() + ")";
                Session["_userId"] = objSessionvalue.UserId.ToString();

            }
            // Added by Ashu on Oct 3, 2011 for rewrite URL
            if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "moments.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "moments.aspx";
            else
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";

            divProfile.Visible = true;
            spanSignUp.Visible = false;
        }
        else if (!_section.Equals(HeaderSecionEnum.inner.ToString()))
        {
            StringBuilder sbl = new StringBuilder();
            sbl.Append("<a href='");
            if (_section.Equals(HeaderSecionEnum.home.ToString()))
            {
                sbl.Append("log_in.aspx");
            }
            else
            {
                sbl.Append("javascript: void(0);' onclick='UserLoginModalpopupFromSubDomain(location.href,document.title);");
            }
            sbl.Append("'>Log in</a>");

            spanSignUp.Visible = !(_section.Equals(HeaderSecionEnum.registration.ToString()));
            lnRegistration.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() +
                "UserRegistration.aspx";

            spanLogout.InnerHtml = sbl.ToString();
            divProfile.Visible = false;
        }

        if (FacebookWebContext.Current.Session == null || objSessionvalue == null)
        {
            StringBuilder sbl = new StringBuilder();
            sbl.Append("<fb:login-button size=\"small\"");

            if (Equals(objSessionvalue, null))
            {
                //LHK: for non logged in user Do not show Facebook
                //sbl.Append("\" onlogin=\"doAjaxLogin();\" v=\"2\"><fb:intl>");
                //sbl.Append("Log in with Facebook");
            }
            else
            {
                sbl.Append("\" onlogin=\"doAjaxConnect();\" v=\"2\"><fb:intl>");
                sbl.Append("Connect");
            }

            sbl.Append("</fb:intl></fb:login-button>");
            sbl.Append(spanLogout.InnerHtml);

            spanLogout.InnerHtml = sbl.ToString();

        }
        // Set the controls value
        SetControlsValue();
    }
    private UserRegistration SaveAccount()
    {
        int usertype = 1;
        if (rdoBusinessAccount.Checked)
            usertype = 2;

        UserRegistration objUserReg = new UserRegistration();
        int state = -1;
        if (ddlStateProvince.SelectedValue != "")
        {
            state = int.Parse(ddlStateProvince.SelectedValue);
        }
        string _Pass = TributePortalSecurity.Security.EncryptSymmetric(txtPassword.Text.ToLower());
        string _UserImage = "images/bg_ProfilePhoto.gif";
        Nullable<Int64> facebookUid = null;

        var fbWebContext = FacebookWebContext.Current;
        if (FacebookWebContext.Current.Session != null)
            {
                facebookUid = fbWebContext.UserId;
                try
                {
                    var fbwc = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
                    string fql = "Select pic_square from user where uid = " + fbWebContext.UserId;
                    JsonArray me2 = (JsonArray)fbwc.Query(fql);

                    var mm = (IDictionary<string, object>)me2[0];
                    if (!string.IsNullOrEmpty((string)mm["pic_square"]))
                {
                    _UserImage = (string)mm["pic_square"]; // get user image
                }
            }
            catch //(Exception ex) // commented by Ud to remove warning
            {
            }
        }

        Users objUsers = new Users(
                                    txtUsername.Text.Trim(),
                                    _Pass,
                                    txtFirstName.Text,
                                    txtLastName.Text,
                                    txtEmail.Text,
                                    "",
                                    chkAgreeReceiveNewsletters.Checked,
                                    txtCity.Text,
                                    state,
                                    int.Parse(ddlCountry.SelectedValue),
                                    usertype,facebookUid,ApplicationType
                                      );
        objUsers.UserImage = _UserImage;
        UserBusiness objUserBus = new UserBusiness();
        //Check for Personal Account.

        //Check for Business Account.
        if (rdoBusinessAccount.Checked)
        {
            objUserBus.Website = txtWebsiteAddress.Text;
            objUserBus.CompanyName = txtBusinessName.Text;
            objUserBus.BusinessType = int.Parse(ddlBusinessType.SelectedValue);
            objUserBus.BusinessAddress = txtStreetAddress.Text;
            objUserBus.ZipCode = txtZipCode.Text;

            objUserBus.Phone = txtPhoneNumber1.Text + txtPhoneNumber2.Text + txtPhoneNumber3.Text;

            objUserReg.UserBusiness = objUserBus;
        }
        objUserReg.Users = objUsers;
        return objUserReg;
    }
Beispiel #60
0
 /// <summary>
 /// BLL想注册表中插入信息
 /// </summary>
 /// <param name="tion"> 实体类UserRegistration对象</param>
 /// <returns>int类型</returns>
 public int BLL_insert_UserRegistration(UserRegistration tion)
 {
     return(new DAL_BolgLogin().DAL_insert_UserRegistration(tion));
 }