Esempio n. 1
0
 public int UpsertEmpAdminUser(EmployerAdminViewModal user)
 {
     user.Password = EncryptionHelper.Encrypt(user.Password);
     using (var db = new E2EWebPortalEntities())
     {
         return(db.sp_UpsertEmpAdminUser(user.AdminUserID
                                         , user.UserName
                                         , user.Password
                                         , user.EmployerID
                                         , user.RoleID
                                         , user.Active
                                         , user.AdminUserFirstName
                                         , user.AdminuserMiddleName
                                         , user.AdminUserLastName
                                         , user.AdminUserNickName
                                         , user.AdminTitle
                                         , user.Address1
                                         , user.Address2
                                         , user.City
                                         , user.State
                                         , user.zip
                                         , user.WorkPhoneNumber
                                         , user.Extn
                                         , user.CellPhoneNumber
                                         , user.PrimaryEmail
                                         , user.SecondaryEmail
                                         , user.IsPrimary));
     }
 }
Esempio n. 2
0
        public JsonResult SignUpEmployerAdmin(FormCollection form)
        {
            EmployerAdminViewModal user = new EmployerAdminViewModal();

            user.UserName            = Convert.ToString(form["UserName"].ToString());
            user.Password            = Convert.ToString(form["Password"].ToString());
            user.AdminUserID         = Convert.ToInt16(form["AdminUserID"] != "" ? form["AdminUserID"].ToString() : "0");
            user.EmployerID          = Convert.ToInt16(form["EmployerID"] != "" ? form["EmployerID"].ToString() : "0");
            user.RoleID              = Convert.ToInt16(form["RoleID"] != "" ? form["RoleID"].ToString() : "0");
            user.Active              = Convert.ToInt16(form["Active"] == "Yes" ? "1" : "0");
            user.AdminUserFirstName  = Convert.ToString(form["AdminUserFirstName"].ToString());
            user.AdminuserMiddleName = Convert.ToString(form["AdminuserMiddleName"].ToString());
            user.AdminUserLastName   = Convert.ToString(form["AdminUserLastName"].ToString());
            user.AdminUserNickName   = Convert.ToString(form["AdminUserNickName"].ToString());
            user.AdminTitle          = Convert.ToString(form["AdminTitle"].ToString());
            user.Address1            = Convert.ToString(form["Address1"].ToString());
            user.Address2            = Convert.ToString(form["Address2"].ToString());
            user.City            = Convert.ToString(form["City"].ToString());
            user.State           = Convert.ToString(form["State"].ToString());
            user.zip             = Convert.ToString(form["zip"].ToString());
            user.WorkPhoneNumber = Convert.ToString(form["WorkPhoneNumber"].ToString());
            user.Extn            = Convert.ToString(form["Extn"].ToString());
            user.CellPhoneNumber = Convert.ToString(form["CellPhoneNumber"].ToString());
            user.PrimaryEmail    = Convert.ToString(form["PrimaryEmail"].ToString());
            user.SecondaryEmail  = Convert.ToString(form["SecondaryEmail"].ToString());
            user.IsPrimary       = Convert.ToBoolean(form["Primary"] == "Yes");



            var result = _userRepo.UpsertEmpAdminUser(user);

            if (result == -1)
            {
                TempData["ConfirmationType"] = "SignUpSuccessful";
                return(Json(new { Code = 1, Message = "You are registered successfully with E2EWebPortal." }));
            }
            else
            {
                return(Json(new { Code = 0, Message = "Something wrong occured! Please try again!" }));
            }
        }