public void UpdateEventTest()
 {
     //void UpdateEvent(int moduleId, int itemId, String userName, String title, DateTime expireDate,
     //             String description, String wherewhen)
     DesktopModulesFacade facade = new DesktopModulesFacade();
     PortalEvent portalevent = new PortalEvent();
     portalevent.ModuleID = 0;
     portalevent.ItemID = 0;
     portalevent.CreatedByUser = "******";
     portalevent.Title = "t";
     portalevent.ExpireDate = new DateTime(2011, 1, 1);
     portalevent.Description = "d";
     portalevent.WhereWhen = "ww";
     facade.UpdateEvent(portalevent);
 }
        //****************************************************************
        //
        // The UpdateBtn_Click event handler on this Page is used to either
        // create or update an event.  It uses the Nairc.KPWPortal.EventsDB()
        // data component to encapsulate all data functionality.
        //
        //****************************************************************
        protected void UpdateBtn_Click(Object sender, EventArgs e)
        {
            // Only Update if the Entered Data is Valid
            if (Page.IsValid == true)
            {
                IDesktopModulesFacade facade = new DesktopModulesFacade();
                PortalEvent portalevent = new PortalEvent();
                portalevent.ModuleID =moduleId;
                portalevent.ItemID =itemId;
                portalevent.CreatedByUser =Context.User.Identity.Name;
                portalevent.Title =TitleField.Text;
                portalevent.ExpireDate =DateTime.Parse(ExpireField.Text);
                portalevent.Description =DescriptionField.Text;
                portalevent.WhereWhen =WhereWhenField.Text;

                if (itemId == 0)
                {
                    // Add the event within the Events table
                    facade.AddEvent(portalevent);
                }
                else
                {
                    // Update the event within the Events table
                    facade.UpdateEvent(portalevent);
                }

                // Redirect back to the portal home page
                Response.Redirect((String) ViewState["UrlReferrer"]);
            }
        }