private void populateViewCalendarDropDown()
 {
     CalendarBLL calendarBLL = new CalendarBLL();
     ArrayList calendarNames = calendarBLL.getCalendars();
     foreach (String name in calendarNames)
     {
         System.Diagnostics.Trace.WriteLine(name);
     }
     ViewDropDown.DataSource = calendarNames;
     ViewDropDown.DataBind();
 }
 private void populateCalendarDropDown(DropDownList temp)
 {
     CalendarBLL calendarBLL = new CalendarBLL();
     ArrayList calendarNames = calendarBLL.getCalendars();
     temp.DataSource = calendarNames;
     temp.DataBind();
 }
        /*private void populateNewProjectDropDown()
        {
            CalendarBLL temp = new CalendarBLL();
            NewProjectDropDown.DataSource = temp.getProjectNames();
            NewProjectDropDown.DataBind();
        }*/
        protected void SaveNewCalendar(object sender, EventArgs e)
        {
            CalendarBLL calendarBLL = new CalendarBLL();
            ArrayList currentCalendars = null;

            String name = calendarName.Text;
            if (name == null || name.Length == 0)
            {
                TopMostMessageBox.Show("Name cannot be empty", "Error");
                return;
            }

            if ((currentCalendars = calendarBLL.getCalendars()) != null)
            {
                foreach (String n in currentCalendars)
                {
                    if (name.Equals(n))
                    {
                        TopMostMessageBox.Show("A calendar with that name already exists.", "Error");
                        return;
                    }
                }
            }

            /*String projectName = ProjectsDropDown.SelectedValue;

            if (projectName == null || projectName.Length == 0)
            {
                TopMostMessageBox.Show("Project cannot be empty", "Error");
                return;
            }*/

            calendarBLL.createCalendar(name);
            InitPanel.Visible = true;
            CreatePanel.Visible = false;
        }
        protected void SaveEdit_Click(object sender, EventArgs e)
        {
            CalendarBLL calendarBLL = new CalendarBLL();

            String calendarToEdit = CalendarDropDown.SelectedValue;
            String newName = EditNameTextBox.Text;

            ArrayList currentCalendars = new ArrayList();
            if ((currentCalendars = calendarBLL.getCalendars()) != null)
            {
                foreach (String n in currentCalendars)
                {
                    if (newName.Equals(n))
                    {
                        TopMostMessageBox.Show("A calendar with that name already exists.", "Error");
                        return;
                    }
                }
            }

            if (newName.Length == 0)
            {
                TopMostMessageBox.Show("Please enter a calendar name.", "Error");
                return;
            }

            /*String newProject = NewProjectDropDown.SelectedValue;

            if (calendarBLL.updateCalendarInfo(calendarToEdit, newName, newProject))
            {
                TopMostMessageBox.Show("Successfully updated " + newName, "Message", MessageBoxButtons.OKCancel);
            }*/

            InitPanel.Visible = true;
            EditPanel.Visible = false;
        }
 protected void populateDeleteEventDropDown()
 {
     CalendarBLL calendarBLL = new CalendarBLL();
     ArrayList calendarNames = calendarBLL.getCalendars();
     DeleteEventDropDown.DataSource = calendarNames;
     DeleteEventDropDown.DataBind();
 }
 public void getCalendarsTest()
 {
     CalendarBLL target = new CalendarBLL();
     ArrayList actual;
     actual = target.getCalendars();
     Assert.IsNotNull(actual);
 }