public edit_event(int eventid)
        {
            InitializeComponent();
            id = eventid;
            Parser       obj           = new Parser("display");
            List <Event> currentevents = new List <Event>();

            currentevents = obj.taskToBePerformed();
            TaskDetails TaskDetailsObject = new TaskDetails();
            Conversions Conversionsobject = new Conversions();

            TaskDetailsObject = Conversionsobject.convertEventsIntoTaskdetails(currentevents[id]);

            textBox2.Text  = TaskDetailsObject.getEventname() == "null" ? " " : TaskDetailsObject.getEventname();
            textBox3.Text  = TaskDetailsObject.getLocation() == "null" ? " " : TaskDetailsObject.getLocation();
            textBox4.Text  = TaskDetailsObject.getStartDate() == "null" ? " " : TaskDetailsObject.getStartDate();
            textBox5.Text  = TaskDetailsObject.getEndDate() == "null" ? " " : TaskDetailsObject.getEndDate();
            textBox6.Text  = TaskDetailsObject.getStartTime() == "null" ? " " : TaskDetailsObject.getStartTime();
            textBox7.Text  = TaskDetailsObject.getEndTime() == "null" ? " " : TaskDetailsObject.getEndTime();
            textBox9.Text  = currentevents[id].Remind_Me_Before == "null" ? " " : TaskDetailsObject.getRemainderTime();
            textBox10.Text = currentevents[id].Priority == "null" ? " " : TaskDetailsObject.getPriority();
            command        = "";
        }
Пример #2
0
 public string convertTaskDetailToWriteIntoFile(TaskDetails objectDetailsOfTask)
 {
     try
     {
         return(objectDetailsOfTask.getEventname() + ";" + objectDetailsOfTask.getLocation() + ";"
                + objectDetailsOfTask.getStartDate() + ";" + objectDetailsOfTask.getEndDate() + ";" +
                objectDetailsOfTask.getStartTime() + ";" + objectDetailsOfTask.getEndTime() + ";" +
                objectDetailsOfTask.getDuration() + ";" + objectDetailsOfTask.getPriority() + ";" +
                objectDetailsOfTask.getRemainderTime() + ";" + objectDetailsOfTask.getRepeat());
     }
     catch (Exception e)
     {
         StreamWriter loggingWriter = new StreamWriter("Logging.txt");
         loggingWriter.WriteLine(System.DateTime.Now + e.Message + "\n");
         loggingWriter.Close();
         return(null);
     }
 }