private UsersEntity GetEntity()
        {
            UsersEntity model = new UsersEntity();

            model          = UsersFactory.CreateUsersEntity(UserInfo.ID, ObjectFactory.GetInstance <ISystemDateTime>());
            model.PassWord = txtPassword.Text;
            // Advance Infomation Sunnet
            model.CompanyID   = int.Parse(ddlCompany.SelectedValue);
            model.CompanyName = ddlCompany.SelectedItem.Text;
            model.UserType    = ddlUserType.SelectedValue;
            model.Office      = ddlOffice.SelectedValue;
            model.RoleID      = int.Parse(ddlRole.SelectedValue);


            // Advance Infomation Client
            model.EmergencyContactFirstName = "Sunnet";
            model.EmergencyContactLastName  = "Sunnet";
            model.EmergencyContactEmail     = "*****@*****.**";
            model.EmergencyContactPhone     = "999-999-9999";

            model.MaintenancePlanOption = UserMaintenancePlanOption.NONE.ToString();
            model.PTOHoursOfYear        = double.Parse(String.Format("{0:F}", PTOhours.Text));


            // basec infomation
            model.FirstName = txtFirstName.Text.Trim();
            model.LastName  = txtLastName.Text.Trim();
            model.UserName  = txtUserName.Text;
            model.Email     = txtUserName.Text.Trim();
            model.Title     = txtTitle.Text.Trim();
            model.Phone     = txtPhone.Text.Trim();
            model.Skype     = txtSkype.Text.Trim();

            model.Status         = ddlStatus.SelectedValue;
            model.ForgotPassword = 0;

            model.IsDelete      = false;
            model.AccountStatus = 0;
            model.IsNotice      = chkNotice.Checked;
            return(model);
        }
Beispiel #2
0
 public PurchaseFirstVersionFacade(MainPage mainPage, CartPage cartPage, CheckoutPage checkoutPage, UsersFactory usersFactory)
 {
     _mainPage     = mainPage;
     _cartPage     = cartPage;
     _checkoutPage = checkoutPage;
     _usersFactory = usersFactory;
 }
Beispiel #3
0
        public ActionResult Users()
        {
            var model = UsersFactory.GetUsersRepository().GetAllUsers();

            return(View(model));
        }
Beispiel #4
0
        private UsersEntity GetEntity()
        {
            UsersEntity model = new UsersEntity();

            if (IsAdd)
            {
                model          = UsersFactory.CreateUsersEntity(BaseWebsitePage.UserInfo.ID, ObjectFactory.GetInstance <ISystemDateTime>());
                model.PassWord = txtPassword.Text;
            }
            else
            {
                model = UserToEdit;
                if (!string.IsNullOrEmpty(txtPassword.Text))
                {
                    model.PassWord       = txtPassword.Text;
                    model.ForgotPassword = UserInfo.ID;
                }
            }
            // Advance Infomation Sunnet
            model.CompanyID   = int.Parse(ddlCompany.SelectedValue);
            model.CompanyName = ddlCompany.SelectedItem.Text;
            model.UserType    = ddlUserType.SelectedValue;
            model.Office      = ddlOffice.SelectedValue;
            model.RoleID      = int.Parse(ddlRole.SelectedValue);

            if (IsSunnet)
            {
                // Advance Infomation Client
                model.EmergencyContactFirstName = "Sunnet";
                model.EmergencyContactLastName  = "Sunnet";
                model.EmergencyContactEmail     = "*****@*****.**";
                model.EmergencyContactPhone     = "999-999-9999";

                model.MaintenancePlanOption = UserMaintenancePlanOption.NONE.ToString();
            }
            else
            {
                // Advance Infomation Client
                model.EmergencyContactFirstName = txtEFirstName.Text.Trim();
                model.EmergencyContactLastName  = txtELastName.Text.Trim();
                model.EmergencyContactEmail     = txtEEmail.Text.Trim();
                model.EmergencyContactPhone     = txtEPhone.Text.Trim();

                //model.MaintenancePlanOption = ClientMaintenancePlan1.SelectedMaintenancePlan.ToString();
            }

            // basec infomation
            model.FirstName = txtFirstName.Text.Trim();
            model.LastName  = txtLastName.Text.Trim();
            model.UserName  = txtUserName.Text;
            model.Email     = txtUserName.Text.Trim();
            model.Title     = txtTitle.Text.Trim();
            model.Phone     = txtPhone.Text.Trim();
            model.Skype     = txtSkype.Text.Trim();

            model.Status         = ddlStatus.SelectedValue;
            model.ForgotPassword = 0;

            model.IsDelete      = false;
            model.AccountStatus = 0;

            return(model);
        }
Beispiel #5
0
 public UsersController(UsersFactory userFactory)
 {
     _usersFactory = userFactory;
 }