Пример #1
0
        private void Setting_OnClick(object sender, RoutedEventArgs e)
        {
            _newEmailPerson = new EmailLogin(_newEmailer);

            _newEmailPerson.ShowDialog();

            if (!string.IsNullOrEmpty(_newEmailPerson.EmailUser))
            {
            }

            try
            {
                _newEmailer = new PersonEmail(_newEmailPerson.EmailUser, _newEmailPerson.EmailPass)
                {
                    SendingTo = _newEmailPerson.SendToEmail
                };

                if (_newEmailPerson.WillSerialize)
                {
                    SerializeEmail(_newEmailer, _emailInfo);
                }

                _emailer = new EmailProcess(_newEmailer.EmailAddress, _newEmailer.Password, _newEmailer.SendingTo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Email information was not entered", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();
            EmailProcess ep = new EmailProcess();

            if (ConfigurationManager.AppSettings["GD"] == "1")
            {
                ep.Initialize_GD();
            }

            ep.CheckEmails();
        }
Пример #3
0
        /// <summary>
        /// This method sends a verification email to the user at the email address they entered in the form.
        /// </summary>
        /// <param name="emailAddress">
        /// The email address
        /// </param>
        /// <param name="item">
        /// The item.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        private bool SendEmail(string emailAddress, EventData item)
        {
            string emailBody = GetEmailMessage(item);

            this.HttpContext.Session["Message"] = emailBody;
            string emailTo = Properties.Settings.Default.devMode
                              ? Properties.Settings.Default.simulatedEmail
                              : emailAddress;
            EmailProcess ep = new EmailProcess(
                Properties.Settings.Default.EmailHost,
                Properties.Settings.Default.EmailPort,
                Properties.Settings.Default.EmailFrom);

            return(ep.SendEmail(emailTo, Properties.Settings.Default.EmailSubject, emailBody));
        }
        public ActionResult EmailSend(LeaveForComment lev)
        {
            EmailProcess email = new EmailProcess();

            email.emailSetting.Body    = lev.Message;
            email.emailSetting.Subject = lev.Topic;
            // ApplicationDbContext db = new ApplicationDbContext();
            // var rm = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(db));


            //   roles = db.ApplicationUserRoles.


            email.EmailSendToAdmin();


            return(RedirectToAction("Contact"));
        }
Пример #5
0
        public MainWindow()
        {
            InitializeComponent();
            _notifyIcon.Icon              = new Icon(Resource.Hopstarter_Mac_Folders_Windows, 20, 20);
            this.StateChanged            += Window_Minimized;
            _notifyIcon.MouseDoubleClick += Window_Unminimized;



            DeserializeEmail(_emailInfo); //check if saved email login exists

            //with no saved login, prompt user
            if (_isEmailSaved == false)
            {
                _newEmailPerson.ShowDialog();

                _newEmailer = new PersonEmail(_newEmailPerson.EmailUser, _newEmailPerson.EmailPass)
                {
                    SendingTo = _newEmailPerson.SendToEmail
                };

                if (_newEmailPerson.WillSerialize)
                {
                    SerializeEmail(_newEmailer, _emailInfo);
                }
            }


            _emailer = new EmailProcess(_newEmailer.EmailAddress, _newEmailer.Password, _newEmailer.SendingTo);

            DeserializeFolders(_folderInfo); //check if saved folders exist

            FolderListView.ItemsSource = _trackingFolderList;

            FolderListView.Items.Refresh();
        }
Пример #6
0
        public async Task <JsonResult> Register(RegisterViewModel model)
        {
            try
            {
                var user = new User();

                #region Email Validity Check
                if (EmailProcess.IsValidEmail(model.Email) == false)
                {
                    return(Json(new JsonMessage {
                        HataMi = true, Baslik = "İşlem Başarısız", Mesaj = "Geçersiz E-Mail Adresi. Lütfen Kontrol Edin."
                    }));
                }
                #endregion

                #region Password Validity Check
                var checkPassword = PasswordProcess.IsValidPassword(model.Password);
                if (checkPassword != null)
                {
                    return(Json(new JsonMessage {
                        HataMi = true, Baslik = "İşlem Başarısız", Mesaj = checkPassword
                    }));
                }
                if (model.Password != model.ReTypePassword)
                {
                    return(Json(new JsonMessage {
                        HataMi = true, Baslik = "İşlem Başarısız", Mesaj = "Lütfen Parola Bilgilerinizi Kontrol Edin."
                    }));
                }
                #endregion

                #region Default Picture Url Settings
                string defautPictureUrl = null;
                if (model.Gender == Constants.Gender.Male)
                {
                    defautPictureUrl = Constants.DefaultPictureUrl.DefaultPictureUrlMale;
                }
                if (model.Gender == Constants.Gender.Female)
                {
                    defautPictureUrl = Constants.DefaultPictureUrl.DefaultPictureUrlFemale;
                }
                #endregion

                #region Default User Type Settings
                var studentUserType = await _userTypeService.SingleOrDefaultAsync(x => x.Code == UserTypes.Student.GetHashCode());

                #endregion

                #region User Sistemde Var Mı Kontrolü
                user = await _userService.SingleOrDefaultAsync(x => x.Email == model.Email && x.Name.ToLower() == model.UserName.ToLower() && x.Surname.ToLower() == model.UserSurname.ToLower() && x.IsDeleted == false);

                if (user != null)
                {
                    return(Json(new JsonMessage {
                        HataMi = true, Baslik = "İşlem Başarısız", Mesaj = "Eklemek istediğiniz özelliklere sahip kullanıcı sistemde zaten mevcut."
                    }));
                }
                #endregion

                #region Kayıt İşlemi

                user = new User
                {
                    Name         = model.UserName,
                    Surname      = model.UserSurname,
                    Email        = model.Email,
                    Password     = PasswordProcess.HesaplaSHA256(model.Password),
                    RegisterDate = DateTime.Now,
                    IsDeleted    = false,
                    UserTypeId   = studentUserType.Id,
                    PictureUrl   = defautPictureUrl,
                    Gender       = model.Gender,
                };
                await _userService.AddAsync(user);

                #endregion

                return(Json(new JsonMessage {
                    HataMi = false, Baslik = "İşlem Başarılı", Mesaj = "Kayıt İşleminiz Başarıyla Gerçekleşti."
                }));
            }
            catch (Exception)
            {
                return(Json(new JsonMessage {
                    HataMi = true, Baslik = "İşlem Başarısız", Mesaj = "İşlem Başarısız. Yöneticinize Başvurun."
                }));
            }
        }
Пример #7
0
        public ActionResult Index(Form data)
        {
            RecaptchaVerificationHelper recaptchaHelper = this.GetRecaptchaVerificationHelper();

            if (string.IsNullOrEmpty(recaptchaHelper.Response))
            {
                this.ModelState.AddModelError(string.Empty, "Captcha answer cannot be empty.");

                return(this.View(data));
            }

            RecaptchaVerificationResult recaptchaResult = recaptchaHelper.VerifyRecaptchaResponse();

            if (recaptchaResult != RecaptchaVerificationResult.Success)
            {
                this.ModelState.AddModelError(string.Empty, "Incorrect captcha answer.");

                return(this.View(data));
            }

            FormValidator validator = new FormValidator();

            validator.Validate(data);

            if (!this.ModelState.IsValid)
            {
                return(this.View(data));
            }

            string emailBody = string.Empty;

            // If at least half of the interest questions were "Agreed" or "Strongly Agreed".
            if (this.CalculateScore(data) >= 6)
            {
                data.IsPotentialStudent = true;

                emailBody  = "Results to Software Development Quiz<br/><br/>";
                emailBody += "Congratulations! It sounds like training for a career in software development could be a good fit for you. We offer a few options that may work well for you.<br/><br/>";
                emailBody += "DEGREES (TWO YEARS)<br/>";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/information-technology/programming-and-development/programming-development-at-tri-c.html{Properties.Settings.Default.TrackingQueryString}\">Programming and Development</a><br/><br/>";
                emailBody += "SHORT-TERM AND POST DEGREE CERTIFICATES (JUST OVER A YEAR)<br/>";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/information-technology/programming-and-development/certificate-in-mobile-application-development.html{Properties.Settings.Default.TrackingQueryString}\">Mobile Application Development</a><br />";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/information-technology/programming-and-development/certificate-in-web-application-development.html{Properties.Settings.Default.TrackingQueryString}\">Web Application Development</a><br/>";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/information-technology/programming-and-development/net-programming.html{Properties.Settings.Default.TrackingQueryString}\">.NET Programming</a><br/>";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/information-technology/programming-and-development/post-degree-certificate-in-programming-and-development.html{Properties.Settings.Default.TrackingQueryString}\">Programming and Development</a><br/><br/>";
                emailBody += "FAST TRACK TRAINING (3-6 MONTHS)<br/>";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/information-technology/programming-and-development/clevelandcodes.html{Properties.Settings.Default.TrackingQueryString}\">Cleveland Codes Software Developers Academy</a><br/><br/>";

                if (Convert.ToBoolean(data.StartNow))
                {
                    emailBody += "One of our staff will be reaching out to you within 48 hours to discuss program options and enrollment procedures.";
                }
                else
                {
                    emailBody += "You indicated that you are not quite ready to begin a training program. We will keep your name on our email list and share program information about upcoming courses.<br/><br/>";
                    emailBody += "If you don’t want future training opportunities emailed to you, please <a href=\"mailto:[email protected]?subject=%20Unsubscribe%20from%20email%20list\">unsubscribe</a>.";
                }
            }
            else
            {
                data.IsPotentialStudent = false;

                emailBody  = "Results to Software Development Quiz<br/><br/>";
                emailBody += "Based on the interests that you self-reported, it sounds like a career in software development might not be the best fit for you. Tri-C offers many different programs so you can find one that’s the right fit for you.<br/><br/>";
                emailBody += "If you like computers, take our <a href=\"https://forms.tri-c.edu/NetworkingQuiz\">computer networking quiz</a> to see if this area is a better match with your interests.<br/><br/>";
                emailBody += "We also offer programs that include technology applications as part of the coursework, such as business technology and entrepreneurial technology. In addition, the Gill and Tommy LiPuma Center for Creative Arts offers 3D design, digital video editing, game design and motion graphics, to name a few.<br /><br />";
                emailBody += $"<a href=\"https://www.tri-c.edu/programs/{Properties.Settings.Default.TrackingQueryString}\">View All Available Programs</a>";
            }

            EmailProcess ep = new EmailProcess(Properties.Settings.Default.EmailHost, Properties.Settings.Default.EmailPort, Properties.Settings.Default.EmailFrom);

            if (!ep.SendEmail(data.Email, "Tri-C Software Development Quiz Confirmation", emailBody))
            {
                return(this.RedirectToAction("Error"));
            }

            ListProcess lp = new ListProcess(
                Properties.Settings.Default.Site,
                Properties.Settings.Default.List,
                AppDBConnection.KwebConnection);

            if (!lp.Add(data))
            {
                return(this.RedirectToAction("Error"));
            }

            return(this.RedirectToAction("Thanks"));
        }
        public async Task <JsonResult> UserLogin(LoginViewModel model)
        {
            #region Email Validity Check
            if (EmailProcess.IsValidEmail(model.UserMail) == false)
            {
                return(Json(new JsonMessage {
                    HataMi = true, Baslik = "İşlem Başarısız", Mesaj = "Geçersiz E-Mail Adresi. Lütfen Kontrol Edin."
                }));
            }
            #endregion

            var password = PasswordProcess.HesaplaSHA256(model.UserPassword).ToLower();
            var user     = await _userService.SingleOrDefaultAsync(x => x.Email == model.UserMail && x.Password == password && x.IsDeleted == false);

            if (user != null)
            {
                #region Session Settings
                var userType = await _userTypeService.GetByIdAsync((int)user.UserTypeId);

                SessionManagement.ActiveUserNameSurname = user.Name + " " + user.Surname;
                SessionManagement.ActiveUserPictureUrl  = user.PictureUrl;
                SessionManagement.ActiveUserId          = user.Id;
                if (userType.Code == UserTypes.Admin.GetHashCode())
                {
                    HttpContext.Session.SetString("IsAdmin", userType.Name);
                    HttpContext.Session.GetString("IsAdmin");
                    SessionManagement.IsAdmin              = true;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.Student.GetHashCode())
                {
                    HttpContext.Session.SetString("IsStudent", userType.Name);
                    HttpContext.Session.GetString("IsStudent");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = true;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.JuryMember.GetHashCode())
                {
                    HttpContext.Session.SetString("IsJuryMember", userType.Name);
                    HttpContext.Session.GetString("IsJuryMember");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = true;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.Assistant.GetHashCode())
                {
                    HttpContext.Session.SetString("IsAssistant", userType.Name);
                    HttpContext.Session.GetString("IsAssistant");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = true;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.Instructor.GetHashCode())
                {
                    HttpContext.Session.SetString("IsInstructor", userType.Name);
                    HttpContext.Session.GetString("IsInstructor");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = true;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.Chair.GetHashCode())
                {
                    HttpContext.Session.SetString("IsChair", userType.Name);
                    HttpContext.Session.GetString("IsChair");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = true;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.Coordinator.GetHashCode())
                {
                    HttpContext.Session.SetString("IsCoordinator", userType.Name);
                    HttpContext.Session.GetString("IsCoordinator");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = true;
                    SessionManagement.IsExternalJuryMember = false;
                }
                if (userType.Code == UserTypes.ExternalJuryMember.GetHashCode())
                {
                    HttpContext.Session.SetString("IsExternalJuryMember", userType.Name);
                    HttpContext.Session.GetString("IsExternalJuryMember");
                    SessionManagement.IsAdmin              = false;
                    SessionManagement.IsStudent            = false;
                    SessionManagement.IsJuryMember         = false;
                    SessionManagement.IsAssistant          = false;
                    SessionManagement.IsInstructor         = false;
                    SessionManagement.IsChair              = false;
                    SessionManagement.IsCoordinator        = false;
                    SessionManagement.IsExternalJuryMember = true;
                }
                #endregion

                return(Json(new JsonMessage {
                    HataMi = false, Baslik = "İşlem Başarılı", Mesaj = "Sisteme Giriş İşlemi Başarıyla Gerçekleşti."
                }));
            }
            return(Json(new JsonMessage {
                HataMi = true, Baslik = "İşlem Başarısız", Mesaj = "Geçersiz Kullanıcı Adı veya Şifre"
            }));
        }