Beispiel #1
0
        public CriteriaForm(MainForm _parrentForm)
        {
            Contract.Requires(_parrentForm.GetType() == typeof(MainForm));

            InitializeComponent();
            Data_Request user_criteria = new Data_Request();

            Contract.Requires(user_criteria.regiondatalist.GetType() == typeof(List<CountryRegionAmt>));

            regiondatalist = user_criteria.regiondatalist;
            amt_selection_cmb.DataSource = regiondatalist;
            amt_selection_cmb.DisplayMember = "name";

            parrentForm = _parrentForm;

            //set displayed settings equal to currently selected settings
            UpdateDisplayedSettings();
        }
Beispiel #2
0
        public Notification(string offer, TextBox system_message_txt, MainForm author_object)
        {
            try
            {
                string baseUrl = "http://www.boligportal.dk";
                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.To.Add("[email protected], [email protected]");
                message.Subject = "New apartment offer found!";
                message.From = new System.Net.Mail.MailAddress("*****@*****.**"); //not actually used, but it's required
                message.Body = "New offer can be seen here: " + baseUrl + offer;

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587); //host and port
                smtp.Credentials = new NetworkCredential("*****@*****.**", "50548288");
                smtp.EnableSsl = true;
                smtp.Send(message);
            }
            catch (Exception ex)
            {
                CrossThreadMsg.CreateMessage(system_message_txt, "Error sending mail: " + ex);
            }
        }
 //CONSTRUCTOR
 public APIQueryHandler(TextBox _system_message_txt, MainForm _parrent_form, GroupBox _parrent_groupbox)
 {
     system_message_txt = _system_message_txt;
     parrentForm = _parrent_form;
     parrentOffer_Groupbox = _parrent_groupbox;
 }