public void createURLNotification(string url, 
Business.AppointmentVO appVO) {
            string subject = "";
if(appVO._Id != null)
                subject = appVO._Subject;
            notificationURL = url;
_notification = new Notification();
_notification.Caption = "News: ";
            _notification.Critical = false;
            //
StringBuilder HTMLString = new StringBuilder();
HTMLString.Append("<html><body>");
HTMLString.Append("<font color=\"#0000FF\">Information); availiable for:</font><br>");
            HTMLString.Append("<font color=\"#0000FF\"><b>Appointment: " + subject + "</b></font><br/>");
            HTMLString.Append("<form method=\"GET\" action=notify>");
            HTMLString.Append("<br/><input type=button name='show' value='Show info'>");
            HTMLString.Append("<input type=button name='cancel' value='Cancel'/>");
HTMLString.Append("</body></html>");
_notification.Text = HTMLString.ToString();
//
_notification.BalloonChanged += new 
BalloonChangedEventHandler(_notification_BalloonChanged);
            _notification.ResponseSubmitted += new 
ResponseSubmittedEventHandler(_notification_ResponseSubmitted);
_notification.InitialDuration = 20;
_notification.Visible = true;
        }
Exemplo n.º 2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Handlers.AppointmentHandler appHandler = new
                                                     Handlers.AppointmentHandler();
            Business.AppointmentVO appVO =
                (Business.AppointmentVO)appHandler.getCurrentAppointment();
            new Handlers.GenerationHandler().generateEvent(null, appVO);
            ArrayList al = new ArrayList();

            al.Contains("work");
        }
Exemplo n.º 3
0
 public void testsub()
 {
     Business.ZoneVO zoneVO_ = new Outlook_1.Business.ZoneVO(1,
                                                             1);
     Handlers.AppointmentHandler appHandler = new
                                              Handlers.AppointmentHandler();
     Business.AppointmentVO appVO =
         (Business.AppointmentVO)appHandler.getCurrentAppointment();
     new Handlers.GenerationHandler().generateEvent(zoneVO_,
                                                    appVO);
 }
Exemplo n.º 4
0
        public Business.AppointmentVO getCurrentAppointment()
        {
            //Shared resources
            Business.AppointmentVO appVo = null;
            //New implementation
            Appointment currentApp = Microsoft.WindowsMobile.Status.
                                     SystemState.CalendarAppointment;// CalendarNextAppointment;

            appVo = new Outlook_1.Business.AppointmentVO(currentApp);
            if (appVo == null)
            {
                return(new Business.AppointmentVO());                //return new empty
            }
            else
            {
                return(appVo);
            }
        }
Exemplo n.º 5
0
        void sms_MessageReceived(object sender,
                                 MessageeInterceptorEventArgs e)
        {
            Handlers.AppointmentHandler appHandler = new
                                                     Handlers.AppointmentHandler();
            Business.AppointmentVO appVO =
                (Business.AppointmentVO)appHandler.getCurrentAppointment();
            if (appVO._Id == null)
            {
                //no current app
            }
            else
            {
                notification = new Microsoft.WindowsCE.Forms.Notification();

                Microsoft.WindowsMobile.PocketOutlook.SmsMessage msg =

                    (Microsoft.WindowsMobile.PocketOutlook.SmsMessage)e.Message;
                msg.Read = true;
                StringBuilder stb = new StringBuilder();
                stb.Append(msg.Body + "<br>");
                stb.Append(msg.Received.ToString() + "<br>");
                stb.Append(msg.From + "<br>");
                notification.BalloonChanged += new
                                               BalloonChangedEventHandler(notification_BalloonChanged);
                notification.Text            = stb.ToString();
                notification.InitialDuration = 10;
                if (appVO._Sensitivity.ToLower().Trim() == "private")
                {
                    notification.Caption = "BlockedSmSMessage";
                    notificationStatus   = true;
                }
                else
                {
                    notification.Caption = "IncommingSMSMessage";
                    notification.Visible = true;
                }
            }
        }
public void generateEvent(Business.ZoneVO zoneVO, 
Business.AppointmentVO appVO) {
            int gpsLocation;
string[] socialState;
if (zoneVO != null)
				 gpsLocation = zoneVO.getZoneID(); //is computed from gps location
            else
                gpsLocation = 0;
            if(appVO._Id != null)
                socialState = appVO.getCategoryTab();
            else
                socialState = new string [] {"0","0"};
            string social0 = socialState[0].ToString().ToLower().Trim();
string social1 = socialState[1].ToString().ToLower().Trim();
#region 1
if (gpsLocation == 1) { //Zone 1, Gamle Oslo
                if (social0 == "work" || social1 == "work") {
                        if (social0=="meeting" || social1=="meeting") {
                            createURLNotification("http://www.nith.no", 
appVO);
                        }
                        else if (social0=="preperation" || social1=="preperation") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="own time" || social1=="owntime") {
                            createURLNotification("url", appVO);
                        }
                }
if (social0 == "travel" || social1 == "travel") {
                        if (social0=="train" || social1=="train") {
                            createURLNotification("url", appVO); 
                        }
else if (social0=="tube" || social1=="tube") {
                           createURLNotification("url", appVO);
                        }
                        else if (social0=="car" || social1=="car") {
                             createURLNotification("url", appVO);
                        }
else if (social0=="foot" || social1=="foot") {
                            
createURLNotification("http://oyafestivalen.com/", appVO);
                        }
                }
                 if (social0 == "leisure" || social1 == "leisure") {
                        if (social0=="shopping" || social1=="shopping") {
                             createURLNotification("url", appVO);
                        }
else if (social0=="cinema" || social1=="cinema") 
{
                             createURLNotification("url", appVO);
                        }
                        else if (social0=="sparetime" || 
social1=="sparetime") {
                             createURLNotification("url", appVO);
                        }
else if (social0=="food" || social1=="food") {
                            createURLNotification("url", appVO);
                        }
                 }
				  }
#endregion
#region 2
else if (gpsLocation == 2) { //Zone 2, Sentrum
               if (social0 == "work" || social1 == "work") {
                     if (social0=="meeting" || social1=="meeting") {
                         createURLNotification("url", appVO);
                        }
					  else if (social0=="preperation" || social1=="preperation") {
                            
createURLNotification("http://www.regjeringen.no/nb.html?id=4", appVO);
                        }
else if (social0=="own time" || social1=="own time") {
                            createURLNotification("url", appVO);
                        }
                    }
                if (social0 == "travel" || social1 == "travel") {
                    if (social0 == "train" || social1 == "train") {
                            
createURLNotification("http://www.nsb.no/internet/jp/trafficdelays/index.jhtml?page=trafficdelays_inc.jhtml", appVO);
                        }
else if (social0=="tube" || social1=="tube") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="car" || social1=="car") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="foot" || social1=="foot") {
                            createURLNotification("url", appVO);
                    }
                }
                 if (social0 == "leisure" || social1 == "leisure") {
                        if (social0=="shopping" || social1=="shopping") {
                            
createURLNotification("http://www.oslocity.no/site/page.aspx?Page=Forside", appVO);
                        }
else if (social0=="cinema" || social1=="cinema") 
{
                            createURLNotification("url", appVO);
                        }
else if (social0=="sparetime" || 
social1=="sparetime") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="food" || social1=="food") {
                            createURLNotification("url", appVO);
                        }
                   }
            }
#endregion
#region 3
else if (gpsLocation == 3) { //Zone 3, Frogner
                if (social0 == "work" || social1 == "work") {
                        if (social0=="meeting" || social1=="meeting") {
						                            
createURLNotification("http://www.norway.com/directories/d_company.asp?lang=47&id=7424", appVO);
                        }
else if (social0=="preperation" || 
social1=="preperation") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="own time" || social1=="own time") {
                            createURLNotification("url", appVO);
                        }
                  }
                if (social0 == "travel" || social1 == "travel") {
                        if (social0=="transport" || social1=="transport") 
{
                            
createURLNotification("http://trafikanten.no/", appVO);
                        }
else if (social0=="tube" || social1=="tube") {
						createURLNotification("url", appVO);
                        }
else if (social0=="car" || social1=="car") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="foot" || social1=="foot") {
                            createURLNotification("url", appVO);
                        }
                       }
                 if (social0 == "leisure" || social1 == "leisure") {
                        if (social0=="shopping" || social1=="shopping") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="cinema" || social1=="cinema") 
{
                            createURLNotification("url", appVO);
                        }
else if (social0=="sparetime" || 
social1=="sparetime") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="food" || social1=="food") {
                            createURLNotification("url", appVO);
                        }
                       
                    
                        }
                
            }
#endregion
			 #region 4
            else if (gpsLocation == 4) { //Zone 4, Grünerløkka
               if (social0 == "work" || social1 == "work") {
                        if (social0=="meeting" || social1=="meeting") {
                            createURLNotification("url", appVO);
// needed? break;
                        }
else if (social0=="preperation" || 
social1=="preperation") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="own time" || social1=="own time") {
                            createURLNotification("url", appVO);
                        }
                       }
                if (social0 == "travel" || social1 == "travel") {
                        if (social0=="train" || social1=="train") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="tube" || social1=="tube") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="car" || social1=="car") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="foot" || social1=="foot") {
                            createURLNotification("url", appVO);
                        }
                         }
                 if (social0 == "leisure" || social1 == "leisure") {
                        if (social0=="shopping" || social1=="shopping") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="culture" || 
social1=="culture") {
                            
createURLNotification("http://www.munch.museum.no/", appVO);
					}
					else if (social0=="sparetime" || 
social1=="sparetime") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="food" || social1=="food") {
                            createURLNotification("url", appVO);
                        }
                       
                        }
                
            }
            #endregion
            #region 5
else if (gpsLocation == 5) { //Zone 5, St. Haugen
               if (social0 == "work" || social1 == "work") {
                        if (social0=="meeting" || social1=="meeting") {
                            createURLNotification("url", appVO);
                            // needed? break;
                        }
else if (social0=="preperation" || 
social1=="preperation") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="own time" || social1=="own time") {
                            createURLNotification("url", appVO);
                        }
                       }
                if (social0 == "travel" || social1 == "travel") {
                        if (social0=="train" || social1=="train") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="tube" || social1=="tube") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="car" || social1=="car") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="foot" || social1=="foot") {
                            createURLNotification("url", appVO);
                       }
                }
                 if (social0 == "leisure" || social1 == "leisure") {
                        if (social0=="shopping" || social1=="shopping") {
                            
createURLNotification("http://www.bogstadveien.no/", appVO);
                        }
else if (social0=="cinema" || social1=="cinema") 
{
                            createURLNotification("url", appVO);
                        }
else if (social0=="sparetime" || 
social1=="sparetime") {
                            createURLNotification("url", appVO);
                        }
                        else if (social0=="food" || social1=="food") {
                            
createURLNotification("http://www.kaffebrenneriet.no/", appVO);
                        }
                      
                        }
                
            }
#endregion
#region 6
else if (gpsLocation == 6) { //for testing home
                if (social0 == "work" || social1 == "work") {
                    if (social0=="meeting" || social1=="meeting") {
                        createURLNotification("url", appVO);
						 // needed? break;
                    }
else if (social0=="preperation" || 
social1=="preperation") {
                        createURLNotification("url", appVO);
                    }
else if (social0=="own time" || social1=="own time") 
{
                        createURLNotification("url", appVO);
                    }
                }
if (social0 == "travel" || social1 == "travel") {
                        if (social0=="train" || social1=="train") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="tube" || social1=="tube") {
                            createURLNotification("url", appVO);
                        }
else if (social0=="car" || social1=="car") {
                            createURLNotification("url", appVO);
                        }
                       else if (social0=="foot" || social1=="foot") {
                            createURLNotification("url", appVO);
                        }
                       
                }
            }
#endregion
        }
public void generateInfo(Business.ZoneVO zoneVO) {
            AppointmentHandler appHandler = new AppointmentHandler();
Business.AppointmentVO appVO = 
(Business.AppointmentVO)appHandler.getCurrentAppointment();
              this.generateEvent(zoneVO, appVO);
        }