Ejemplo n.º 1
0
        public void setupNew(AutomatedReminders p)
        {
            ////// NO ACTIONS to start //////
            action.ShowEmail       = action.ShowTicket = action.ShowRSSE = action.ShowReport = action.ShowSSIS = false;
            actionEmail.Visibility = actionTicket.Visibility = actionRSSE.Visibility = actionReport.Visibility = actionSSIS.Visibility = System.Windows.Visibility.Collapsed;

            /////// Default to weekly //////
            currentFT = schedSelectFrequency.freqType.WEEKLY;
            setupForFrequency(currentFT);
            filterDayOfMonth.setMode(true, 32, 0, 0);
            filterMonth.ShowMonths = allmonths;
            selectorFrequency.setVisualState(currentFT);
            filterTime.ShowTime = DateTime.Parse("1/1/2001 20:00 PM");
            parent = p;

            actionEmail.clear();

            ////// NEW / EDIT INFO //////
            edit = false;
            id   = "";
        }
Ejemplo n.º 2
0
        public void setupEdit(System.Data.DataRowView dataRow, AutomatedReminders p)
        {
            setupNew(p);

            if (dataRow["NotificationFrequency"].ToString() == "ONCE")
            {
                setupForFrequency(schedSelectFrequency.freqType.ONCE);
                selectorFrequency.setVisualState(schedSelectFrequency.freqType.ONCE);

                string   NotificationSpecificDate = dataRow["NotificationSpecificDate"].ToString(); // = dayno.ToString();
                DateTime dt = Convert.ToDateTime(NotificationSpecificDate);
                if (dt.Year == 1900)
                {
                    filterDate.setDate(null);
                }
                else
                {
                    filterDate.setDate(dt);
                }
            }
            if (dataRow["NotificationFrequency"].ToString() == "DAILY")
            {
                setupForFrequency(schedSelectFrequency.freqType.DAILY);
                selectorFrequency.setVisualState(schedSelectFrequency.freqType.DAILY);
            }

            if (dataRow["NotificationFrequency"].ToString() == "MONTHLY")
            {
                setupForFrequency(schedSelectFrequency.freqType.MONTHLY);
                selectorFrequency.setVisualState(schedSelectFrequency.freqType.MONTHLY);

                string NotificationDayOfMonth = dataRow["NotificationDayOfMonth"].ToString(); // = dayno.ToString();
                string NotificationWeek       = dataRow["NotificationWeek"].ToString();       // = week.ToString();
                string NotificationWeekDOW    = dataRow["NotificationWeekDOW"].ToString();    // = day.ToString();
                bool   dayMode = (NotificationDayOfMonth == "0") ? false : true;

                filterDayOfMonth.setMode(dayMode, Convert.ToInt32(NotificationDayOfMonth), Convert.ToInt32(NotificationWeek), Convert.ToInt32(NotificationWeekDOW));

                ////// MONTH SELECTOR //////
                string NotificationMonths = dataRow["NotificationMonths"].ToString(); // = filterMonth.ShowMonths;
                filterMonth.ShowMonths = NotificationMonths;
            }
            if (dataRow["NotificationFrequency"].ToString() == "WEEKLY")
            {
                setupForFrequency(schedSelectFrequency.freqType.WEEKLY);
                selectorFrequency.setVisualState(schedSelectFrequency.freqType.WEEKLY);
            }

            if ((dataRow["NotificationFrequency"].ToString() == "DAILY") || (dataRow["NotificationFrequency"].ToString() == "WEEKLY"))
            {
                ////// DAY OF WEEK SELECTOR //////
                filterDOW.ShowDays = dataRow["NotificationDays"].ToString();
            }

            ////// E-MAIL //////
            string EmailTo      = dataRow["EmailTo"].ToString();      // = actionEmail.getToAddresses();
            string EmailSubject = dataRow["EmailSubject"].ToString(); // = actionEmail.getSubject();
            string EmailBody    = dataRow["EmailBody"].ToString();    // = actionEmail.getBody();

            actionEmail.setBody(EmailBody);
            actionEmail.setSubject(EmailSubject);
            actionEmail.setToAddresses(EmailTo);
            if (EmailTo != "")
            {
                action.ShowEmail = true;
            }
            else
            {
                action.ShowEmail = false;
            }

            processSelectionChanged();

            ////// SD TICKET //////
            string cat      = dataRow["TicketCategory"].ToString();
            string sub      = dataRow["TicketSubcategory"].ToString();
            string itm      = dataRow["TicketItem"].ToString();
            string priority = dataRow["TicketPriority"].ToString();
            string site     = dataRow["TicketSite"].ToString();
            string group    = dataRow["TicketGroup"].ToString();
            string subject  = dataRow["TicketSubject"].ToString();
            string desc     = dataRow["TicketDescription"].ToString();
            string tech     = dataRow["TicketTechnician"].ToString();

            actionTicket.Load();
            if (cat != "")
            {
                action.ShowTicket       = true;
                actionTicket.Visibility = System.Windows.Visibility.Visible;

                // Was
                // actionTicket.setItems(cat, sub, itm, priority, site, group, sub, desc, tech);

                // Oct 2 2016
                actionTicket.setItems(cat, sub, itm, priority, site, group, subject, desc, tech);
            }

            ////// NEW / EDIT INFO //////
            edit = true;
            id   = dataRow["NotificationID"].ToString();
        }