Пример #1
0
        public ActionResult NewUserRequest(
            string First_Name_NU,
            string Last_Name_NU,
            string Email_NU,
            string Phone_NU,
            string Call_Letters_NU,
            string Title_NU
            )
        //public ActionResult NewUserRequest(
        //	string emailBody
        //)
        {
            var viewModel    = new SignInViewModel();
            var drCRCManager = CRCDataAccess.GetCRCManager();

            if (drCRCManager != null)
            {
                viewModel.CRCManagerEmail      = drCRCManager["Email"].ToString();
                viewModel.CRCManagerPhone      = drCRCManager["Phone"].ToString();
                viewModel.CRCManagerFirstName  = drCRCManager["FirstName"].ToString();
                viewModel.CRCManagerMiddleName = drCRCManager["MiddleName"].ToString();
                viewModel.CRCManagerLastName   = drCRCManager["LastName"].ToString();
                viewModel.userId = Convert.ToInt64(drCRCManager["UserId"]);
                //viewModel.Email = Session["useremail"].ToString();
            }
            string UserEmail = CRCUser.Email;
            string emailBody = viewModel.CRCManagerFirstName + " - Please Add the User below to station: " + Call_Letters_NU + "\n\n";

            emailBody += "First Name: " + "  " + First_Name_NU;
            emailBody += "\n" + "Last Name:" + "  " + Last_Name_NU;
            emailBody += "\n" + "Email: " + "  " + Email_NU;
            emailBody += "\n" + "Phone: " + "  " + Phone_NU;
            emailBody += "\n" + "Call Letters: " + "  " + Call_Letters_NU;
            emailBody += "\n" + "Title: " + "  " + Title_NU;
            emailBody += "\n" + "Submitted By:" + "  " + UserEmail;



            InfEmail.AddToQueue(UserEmail, viewModel.CRCManagerEmail, "New CRC User Request: " + Call_Letters_NU, emailBody, 1);
            //try
            //{
            //	CRCDataAccess.RemoveUserStationLink(userId, stationId);
            //}
            //catch (EntitySqlException e)
            //{
            //	Console.Write(e);
            //}


            //if (primaryUserId.HasValue)
            //{

            //	if (userId == primaryUserId)
            //	{
            //		CRCDataAccess.UpdatePrimaryUserStatus(stationId);
            //	}
            //}
            return(Json("1", JsonRequestBehavior.AllowGet));
        }
        public AddEditCRCUserViewModel()
        {
            EnabledInd    = true;
            UserRolesList = new[] { "Station User", "System Administrator" }.ToSelectListItems().AddBlankFirstItem();

            var drCrcManager = CRCDataAccess.GetCRCManager();

            if (drCrcManager != null)
            {
                CrcManagerUserId      = drCrcManager["UserId"] as long?;
                CrcManagerDisplayName = drCrcManager["UserDisplayName"].ToString();
            }
        }
Пример #3
0
        public ActionResult SignIn()
        {
            var viewModel = new SignInViewModel();

            var drCRCManager = CRCDataAccess.GetCRCManager();

            if (drCRCManager != null)
            {
                viewModel.CRCManagerEmail = drCRCManager["Email"].ToString();
                viewModel.CRCManagerPhone = drCRCManager["Phone"].ToString();
            }

            return(View(viewModel));
        }
Пример #4
0
        public ActionResult ContactCRCManager()
        {
            var viewModel = new SignInViewModel();

            var drCRCManager = CRCDataAccess.GetCRCManager();

            if (drCRCManager != null)
            {
                viewModel.CRCManagerEmail      = drCRCManager["Email"].ToString();
                viewModel.CRCManagerPhone      = drCRCManager["Phone"].ToString();
                viewModel.CRCManagerFirstName  = drCRCManager["FirstName"].ToString();
                viewModel.CRCManagerMiddleName = drCRCManager["MiddleName"].ToString();
                viewModel.CRCManagerLastName   = drCRCManager["LastName"].ToString();
                viewModel.userId = Convert.ToInt64(drCRCManager["UserId"]);
                viewModel.Email  = Session["useremail"].ToString();
            }

            return(View(viewModel));
        }