Exemplo n.º 1
0
        public void createTodaysTasks()
        {
            //if todays tasklist has not yet been generated do it now
            dataBase db = new dataBase();

            XmlDocument xdoc = new XmlDocument();
            FileStream rfile = new FileStream(path + @"tasks\tasklist.xml", FileMode.Open);
            xdoc.Load(rfile);
            XmlNodeList list = xdoc.GetElementsByTagName("task");
            for (int i = 0; i < list.Count; i++)
            {
                XmlElement taskName = (XmlElement)xdoc.GetElementsByTagName("task_name")[i];
                XmlElement frequency = (XmlElement)xdoc.GetElementsByTagName("frequency")[i];
                if (frequency.InnerText == "daily")
                {
                    ArrayList element = new ArrayList();
                    ArrayList text = new ArrayList();
                    //the name of the xml element to be added
                    element.Add("date");
                    //the text inside the xml element to be added
                    text.Add(fileNameDate);
                    //the name of the xml element to be added
                    element.Add("task");
                    //the text inside the xml element to be added
                    text.Add(taskName.InnerText);
                    //the description text of the xml element to be added
                    element.Add("description");
                    //the xml text to be added
                    text.Add("");
                    //the description text of the xml element to be added
                    element.Add("completed");
                    //the text inside the xml element to be added
                    text.Add("false");
                    //save each task as an xml element
                    db.write(path + fileNameDate + ".xml", element, text, "tasks");
                }
            }
            rfile.Close();
        }
Exemplo n.º 2
0
        public void addContractorVisitToXml(string company, string description)
        {
            dataBase db = new dataBase();

            XmlDocument xdoc = new XmlDocument();
            FileStream rfile = new FileStream(path + @"contractors\lists\contractors.xml", FileMode.Open);
            xdoc.Load(rfile);
            XmlNodeList list = xdoc.GetElementsByTagName("contractor");
            for (int i = 0; i < list.Count; i++)
            {
                XmlElement xCompany = (XmlElement)xdoc.GetElementsByTagName("company")[i];
                if (xCompany.InnerText == company)
                {
                    XmlElement xName = (XmlElement)xdoc.GetElementsByTagName("name")[i];
                    ArrayList element = new ArrayList();
                    ArrayList text = new ArrayList();
                    //the name of the xml element to be added
                    element.Add("name");
                    //the text inside the xml element to be added
                    text.Add(xName.InnerText);
                    //the name of the xml element to be added
                    element.Add("company");
                    //the text inside the xml element to be added
                    text.Add(xCompany.InnerText);
                    //the description text of the xml element to be added
                    element.Add("description");
                    //the xml text to be added
                    text.Add(description);
                    //the description text of the xml element to be added
                    element.Add("date");
                    //the text inside the xml element to be added
                    text.Add(fileNameDate);
                    //save each task as an xml element
                    db.write(path + @"contractors\"+fileNameDate+".xml", element, text, "visitor");
                }
            }
            rfile.Close();
        }
Exemplo n.º 3
0
        private void createExtraTasks()
        {
            try
            {

                //if extra tasklist has not yet been generated do it now
                dataBase db = new dataBase();

                XmlDocument xdoc = new XmlDocument();
                FileStream rfile = new FileStream(path + @"tasks\tasklist.xml", FileMode.Open);
                xdoc.Load(rfile);

                XmlNodeList list = xdoc.GetElementsByTagName("task");
                for (int i = 0; i <= list.Count; i++)
                {
                    XmlElement taskName = (XmlElement)xdoc.GetElementsByTagName("task_name")[i];
                    XmlElement frequency = (XmlElement)xdoc.GetElementsByTagName("frequency")[i];

                    if (frequency.InnerText == "weekly")
                    {
                        for (int w = 0; w < 4; w++)
                        {
                            ArrayList element = new ArrayList();
                            ArrayList text = new ArrayList();
                            //the name of the xml element to be added
                            element.Add("task");
                            //the text inside the xml element to be added
                            text.Add(taskName.InnerText);
                            //the name of the xml element to be added
                            element.Add("weekly_or_monthly");
                            //the text inside the xml element to be added
                            text.Add("weekly");
                            //the name of the xml element to be added
                            element.Add("completed");
                            //the text inside the xml element to be added
                            text.Add("false");
                            //the name of the xml element to be added
                            element.Add("date_completed");
                            //the text inside the xml element to be added
                            text.Add("");
                            //save each task as an xml element
                            db.write(path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml", element, text, "extra_tasks");
                        }
                    }
                    else if (frequency.InnerText == "two_monthly")
                    {
                        string date = xdoc.GetElementsByTagName("month")[i].InnerText;

                        DateTime startDate = DateTime.Now;

                            if (date == startDate.AddMonths(2).ToString("MMMM")
                             || date == startDate.AddMonths(4).ToString("MMMM")
                             || date == startDate.AddMonths(6).ToString("MMMM")
                             || date == startDate.AddMonths(8).ToString("MMMM")
                             || date == startDate.AddMonths(10).ToString("MMMM")
                             || date == startDate.AddMonths(12).ToString("MMMM"))
                            {

                                ArrayList element = new ArrayList();
                                ArrayList text = new ArrayList();
                                //the name of the xml element to be added
                                element.Add("task");
                                //the text inside the xml element to be added
                                text.Add(taskName.InnerText);
                                //the name of the xml element to be added
                                element.Add("weekly_or_monthly");
                                //the text inside the xml element to be added
                                text.Add(frequency.InnerText);
                                //the name of the xml element to be added
                                element.Add("completed");
                                //the text inside the xml element to be added
                                text.Add("false");
                                //the name of the xml element to be added
                                element.Add("date_completed");
                                //the text inside the xml element to be added
                                text.Add("");
                                //save each task as an xml element
                                db.write(path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml", element, text, "extra_tasks");
                            }

                            else {  }

                    }

                    else if (frequency.InnerText == "three_monthly")
                    {
                        string date = xdoc.GetElementsByTagName("date")[i].ToString();
                        if (getMonthAsInt(date) == getMonthAsInt(date) || getMonthAsInt(date) == getMonthAsInt(date) + 3)
                        {
                            ArrayList element = new ArrayList();
                            ArrayList text = new ArrayList();
                            //the name of the xml element to be added
                            element.Add("task");
                            //the text inside the xml element to be added
                            text.Add(taskName.InnerText);
                            //the name of the xml element to be added
                            element.Add("weekly_or_monthly");
                            //the text inside the xml element to be added
                            text.Add(frequency.InnerText);
                            //the name of the xml element to be added
                            element.Add("completed");
                            //the text inside the xml element to be added
                            text.Add("false");
                            //the name of the xml element to be added
                            element.Add("date_completed");
                            //the text inside the xml element to be added
                            text.Add("");
                            //save each task as an xml element
                        }
                    }
                    else if (frequency.InnerText == "six_monthly")
                    {
                        DateTime startDate = DateTime.Now;
                        string date = xdoc.GetElementsByTagName("month")[i].ToString();
                           if  (date == startDate.AddMonths(6).ToString("MMMM")
                             || date == startDate.AddMonths(12).ToString("MMMM"))

                        {
                            ArrayList element = new ArrayList();
                            ArrayList text = new ArrayList();
                            //the name of the xml element to be added
                            element.Add("task");
                            //the text inside the xml element to be added
                            text.Add(taskName.InnerText);
                            //the name of the xml element to be added
                            element.Add("weekly_or_monthly");
                            //the text inside the xml element to be added
                            text.Add(frequency.InnerText);
                            //the name of the xml element to be added
                            element.Add("completed");
                            //the text inside the xml element to be added
                            text.Add("false");
                            //the name of the xml element to be added
                            element.Add("date_completed");
                            //the text inside the xml element to be added
                            text.Add("");
                            //save each task as an xml element
                        }
                    }
                    else if (frequency.InnerText == "monthly")
                    {
                        ArrayList element = new ArrayList();
                        ArrayList text = new ArrayList();
                        //the name of the xml element to be added
                        element.Add("task");
                        //the text inside the xml element to be added
                        text.Add(taskName.InnerText);
                        //the name of the xml element to be added
                        element.Add("weekly_or_monthly");
                        //the text inside the xml element to be added
                        text.Add(frequency.InnerText);
                        //the name of the xml element to be added
                        element.Add("completed");
                        //the text inside the xml element to be added
                        text.Add("false");
                        //the name of the xml element to be added
                        element.Add("date_completed");
                        //the text inside the xml element to be added
                        text.Add("");
                        //save each task as an xml element

                        db.write(path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml", element, text, "extra_tasks");
                    }
                    else { }

                    rfile.Close();
                }
            }
            catch (Exception err)
            {
                debugTerminal terminal = new debugTerminal();
                terminal.output(err.ToString());
            }
        }
Exemplo n.º 4
0
        public void startUp()
        {
            try
            {
                dataBase db = new dataBase();
                fileFolder ff = new fileFolder();
                //check the core folder database exists - if not create it
                ff.createFolder(path);
                ff.createFolder(path + @"extra\");
                ff.createFolder(path + @"tasks\");
                ff.createFolder(path + @"maintenence\");
                ff.createFolder(path + @"maintenence\inventory\");
                ff.createFolder(path + @"contractors\");
                ff.createFolder(path + @"contractors\lists\");
                ff.createFolder(path + @"\contractors\providers\lists\");
                ff.createFolder(Application.StartupPath + @"\database\config\");
                ff.createFolder(Application.StartupPath + @"\database\temp\");

                db.create("contractor_lists", path + @"\contractors\lists\contractors.xml");
                db.create("contractors_today", path + @"\contractors\" + fileNameDate + ".xml");
                db.create("provider_lists", path + @"\contractors\providers\lists\providers.xml");

                //check if tasks xml datbase exists
                db.create("tasks", path + @"tasks\tasklist.xml");
                if (db.create("extra_tasks", path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml"))
                {
                    createExtraTasks();
                }

                //check if todays tasks xml datbase exists
                if (db.create("root", path + DateTime.Now.ToString("d-MM-yyyy") + ".xml"))
                {
                    //file does not exist returns true - create todays tasks
                    createTodaysTasks();
                }
                db.create("inventory", path + @"maintenence\inventory\list.xml");
                db.create("item_maintenence", path + @"maintenence\"+fileNameDate+".xml");

                //check for update

            }
            catch (Exception err)
            {
                debugTerminal terminal = new debugTerminal();
                terminal.output(err.ToString());
            }
        }
Exemplo n.º 5
0
        public string getContractorName(string company)
        {
            dataBase db = new dataBase();

            XmlDocument xdoc = new XmlDocument();

            xdoc.Load(path + @"contractors\lists\contractors.xml");
            XmlNodeList list = xdoc.GetElementsByTagName("contractor");
            for (int i = 0; i < list.Count; i++)
            {
                XmlElement xCompany = (XmlElement)xdoc.GetElementsByTagName("company")[i];

                if (xCompany.InnerText == company)
                {
                    XmlElement xName = (XmlElement)xdoc.GetElementsByTagName("name")[i];
                    return xName.InnerText;
                }
            }

            return "";
        }
Exemplo n.º 6
0
        public void loadDashboard()
        {
            //if todays tasklist has not yet been generated do it now
            applicationCore ap = new applicationCore(fileNameDate);
            dataBase db = new dataBase();
            richTextBoxDashTasks.Text += "Daily Tasks that need attention \n\n";
            XmlDocument xdoc = new XmlDocument();
            FileStream rfile = new FileStream(ap.path + fileNameDate + ".xml", FileMode.Open);
            xdoc.Load(rfile);
            XmlNodeList list = xdoc.GetElementsByTagName("task");
            for (int i = 0; i < list.Count; i++)
            {
                XmlElement taskName = (XmlElement)xdoc.GetElementsByTagName("task")[i];
                XmlElement completed = (XmlElement)xdoc.GetElementsByTagName("completed")[i];
                if (completed.InnerText == "false")
                {
                    richTextBoxDashTasks.Text += taskName.InnerText + " - Not Completed\n" ;
                }
            }

            richTextBoxDashTasks.Text += "\n\nWeekly & Monthly Tasks that need attention \n\n";
            //now extra tasks
            rfile = new FileStream(ap.path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml", FileMode.Open);
            xdoc.Load(rfile);
            list = xdoc.GetElementsByTagName("task");
            for (int i = 0; i < list.Count; i++)
            {
                XmlElement taskName = (XmlElement)xdoc.GetElementsByTagName("task")[i];
                XmlElement completed = (XmlElement)xdoc.GetElementsByTagName("completed")[i];
                XmlElement frequency = (XmlElement)xdoc.GetElementsByTagName("weekly_or_monthly")[i];
                if (completed.InnerText == "false")
                {
                    richTextBoxDashTasks.Text += taskName.InnerText + " - Not Completed\n";
                }
            }
            rfile.Close();
            //contractors
            richTextBoxDashTasks.Text += "\n\nContractors Visting \n\n";
            //now extra tasks
            rfile = new FileStream(ap.path + @"contractors\lists\contractors.xml", FileMode.Open);
            xdoc.Load(rfile);
            list = xdoc.GetElementsByTagName("contractor");
            for (int i = 0; i < list.Count; i++)
            {
                XmlElement name = (XmlElement)xdoc.GetElementsByTagName("name")[i];
                XmlElement company = (XmlElement)xdoc.GetElementsByTagName("company")[i];
                XmlElement next = (XmlElement)xdoc.GetElementsByTagName("next_visit")[i];
                int result = DateTime.Compare(Convert.ToDateTime(next.InnerText), DateTime.Now);
                if (result >= 0)
                {
                    richTextBoxDashTasks.Text += name.InnerText + " from " + company.InnerText + " - Due in "+result+" days \n";
                }
            }
            rfile.Close();
        }
Exemplo n.º 7
0
        private void addTask(object sender, EventArgs e)
        {
            try
            {
                if (textBoxFutureName.Text.Length > 3)
                {
                    dataBase db = new dataBase();
                    applicationCore ap = new applicationCore(fileNameDate);
                    ArrayList element = new ArrayList();
                    //add the xml elements names
                    element.Add("task_name");
                    element.Add("description");
                    element.Add("frequency");
                    ArrayList text = new ArrayList();

                    //add the xml elements text values
                    text.Add(textBoxFutureName.Text);
                    text.Add("");
                    if (radioButtonDailyTask.Checked) { text.Add("daily"); }
                    else if (radioButtonWeeklyTask.Checked) { text.Add("weekly"); }
                    else if (radioButtonMonthlyTask.Checked) { text.Add("monthly"); }
                    else if (radioButtonTwoMonthly.Checked)
                    {
                        text.Add("two_monthly");
                        element.Add("month");
                        text.Add(DateTime.Now.ToString("MMMM"));
                    }
                    else if (radioButtonThreeMonthly.Checked)
                    {
                        text.Add("three_monthly");
                        element.Add("month");
                        text.Add(DateTime.Now.ToString("MMMM"));
                    }
                    else if (radioButtonSixMonthly.Checked)
                    {
                        text.Add("six_monthly");
                        element.Add("month");
                        text.Add(DateTime.Now.ToString("MMMM"));
                    }

                    //write new task to tasklist
                    db.write(ap.path + @"tasks/tasklist.xml", element, text, "task");

                    loadAllTheTasks();
                    //add/ write the new task to todays task
                    if (radioButtonDailyTask.Checked)
                    {
                        ArrayList elementName = new ArrayList();
                        elementName.Add("task");
                        elementName.Add("description");
                        elementName.Add("completed");
                        ArrayList textValue = new ArrayList();
                        textValue.Add(textBoxFutureName.Text);
                        textValue.Add("");
                        textValue.Add("false");
                        db.write(ap.path + fileNameDate + ".xml", elementName, textValue, "tasks");
                    }
                    if (radioButtonWeeklyTask.Checked)
                    {
                        for (int w = 0; w < 4; w++)
                        {
                            ArrayList elementNameTwo = new ArrayList();
                            elementNameTwo.Add("date");
                            elementNameTwo.Add("task");
                            elementNameTwo.Add("description");
                            elementNameTwo.Add("weekly_or_monthly");
                            elementNameTwo.Add("completed");
                            elementNameTwo.Add("date_completed");
                            ArrayList textValueTwo = new ArrayList();
                            textValueTwo.Add(fileNameDate);
                            textValueTwo.Add(textBoxFutureName.Text);
                            textValueTwo.Add("");
                            textValueTwo.Add("weekly");

                            textValueTwo.Add("false");
                            textValueTwo.Add("");
                            db.write(ap.path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml",
                                elementNameTwo, textValueTwo, "extra_tasks");
                        }
                    }
                    if (radioButtonMonthlyTask.Checked)
                    {
                        ArrayList elementNameTwo = new ArrayList();
                        elementNameTwo.Add("date");
                        elementNameTwo.Add("task");
                        elementNameTwo.Add("description");
                        elementNameTwo.Add("weekly_or_monthly");
                        elementNameTwo.Add("completed");
                        elementNameTwo.Add("date_completed");
                        ArrayList textValueTwo = new ArrayList();
                        textValueTwo.Add(fileNameDate);
                        textValueTwo.Add(textBoxFutureName.Text);
                        textValueTwo.Add("");

                        textValueTwo.Add("monthly");
                        textValueTwo.Add("false");
                        textValueTwo.Add("");
                        db.write(ap.path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml",
                            elementNameTwo, textValueTwo, "extra_tasks");

                    }
                    loadTodaysTasks(selectedDate);
                    loadExtraTasks();

                    labelAddTaskValidate.Text = "Task added succesfully";
                }
                else { labelAddTaskValidate.Text = "Task must not already exist and has to be over three letters long."; }
            }

            catch (Exception err) { labelAddTaskValidate.Text = "Adding task failed";
            debugTerminal terminal = new debugTerminal();
            terminal.output(err.ToString());
            }
        }
Exemplo n.º 8
0
        private void AddProvider(object sender, EventArgs e)
        {
            try
            {
                dataBase db = new dataBase();
                applicationCore ap = new applicationCore(fileNameDate);
                ArrayList element = new ArrayList();
                //add the xml elements names
                element.Add("name");
                element.Add("due_date");
                element.Add("date_completed");
                ArrayList text = new ArrayList();
                text.Add(textBoxAddProvidersName.Text);
                text.Add(textBoxAddProviderDueDate.Text);
                text.Add(textBoxAddProviderDateCompleted.Text);

                db.write(ap.path + @"\contractors\providers\lists\providers.xml",
                                element, text, "provider");
                labelAddProviderValidate.Text = "Adding provider succeded";
                loadAllProviders();
            }
            catch (Exception err)
            {
                debugTerminal terminal = new debugTerminal();
                terminal.output(err.ToString());
                labelAddProviderValidate.Text = "Adding provider failed";
            }
        }
Exemplo n.º 9
0
 private void loadSelectedMaintenenceItems(object sender, EventArgs e)
 {
     selectedDate = this.dateTimePicker3.Value.ToString("d-MM-yyyy");
     applicationCore ap = new applicationCore(selectedDate);
     dataBase db = new dataBase();
     if (!File.Exists(ap.path + @"maintenence\" + selectedDate + @".xml"))
     {
         labelMaintenenceNoTasks.Visible = true;
         buttonNoMaintenenceItems.Visible = true;
     }
     else
     {
         selectedDate = fileNameDate;
         labelMaintenenceNoTasks.Visible = false;
         buttonNoMaintenenceItems.Visible = false;
     }
 }
Exemplo n.º 10
0
 private void addItemMaintenence(object sender, EventArgs e)
 {
     try
     {
         dataBase db = new dataBase();
         applicationCore ap = new applicationCore(fileNameDate);
         ArrayList element = new ArrayList();
         //add the xml elements names
         element.Add("item");
         element.Add("area");
         element.Add("quantity");
         ArrayList text = new ArrayList();
         text.Add(textBoxAddInventoryItem.Text);
         text.Add(textBoxAddInventoryArea.Text);
         text.Add(textBoxAddInventoryQuantity.Text);
         labelAddInventoryValidate.Text = textBoxAddInventoryItem.Text + " succesfully added";
         textBoxAddInventoryItem.Clear();
         db.write(ap.path + @"maintenence\inventory\" + "list.xml",
                         element, text, "items");
         loadInventoryItems();
     }
     catch (Exception err)
     {
         debugTerminal terminal = new debugTerminal();
         terminal.output(err.ToString());
     }
 }
Exemplo n.º 11
0
        private void AddContractors(object sender, EventArgs e)
        {
            try
            {
                dataBase db = new dataBase();
                applicationCore ap = new applicationCore(fileNameDate);
                ArrayList element = new ArrayList();
                //add the xml elements names
                element.Add("name");
                element.Add("company");
                element.Add("phone");
                element.Add("description");
                element.Add("next_visit");
                element.Add("certification_no");
                ArrayList text = new ArrayList();
                text.Add(textBoxAddContractorName.Text);
                text.Add(textBoxAddContractorCompany.Text);
                text.Add(textBoxAddContractorPhone.Text);
                text.Add(richTextBoxAddContractorDescription.Text);
                text.Add(textBoxAddContractorNextVisit.Text);
                text.Add(textBoxAddContractorCertNumber.Text);

                //if contractor visits is re-occuring
                if (checkBoxAddContractorEveryXMonths.Checked)
                {
                    element.Add("every");
                    element.Add("frequency");
                    text.Add(textBoxAddContractorAmountOfTimeBetweenVisits.Text);
                    text.Add(comboBoxAddContractorPeriodOfTime.Text);
                }

                db.write(ap.path + @"\contractors\lists\contractors.xml",
                                element, text, "contractor");
                labelAddContractorValidate.Text = "Adding contractor succeded";
                loadAllContractors();
            }
            catch (Exception err)
            {
                debugTerminal terminal = new debugTerminal();
                terminal.output(err.ToString());
                labelAddContractorValidate.Text = "Adding contractor failed";
            }
        }
Exemplo n.º 12
0
 private void updateAddOneOffDailyTask(object sender, EventArgs e)
 {
     dataBase db = new dataBase();
     applicationCore ap = new applicationCore(fileNameDate);
     ArrayList element = new ArrayList();
     //add the xml elements names
     element.Add("date");
     element.Add("task");
     element.Add("description");
     element.Add("completed");
     ArrayList text = new ArrayList();
     //add the xml elements text values
     text.Add(fileNameDate);
     text.Add(textBoxTodaysTasksExtraTask.Text);
     text.Add(richTextBoxTodaysTaskAddDescrition.Text);
     if (checkBoxAddOneOffTask.Checked)
     {
         text.Add("true");
     }
     else
     {
         text.Add("false");
     }
     db.write(ap.path + selectedDate + @".xml", element, text, "tasks");
     labelAddOneOffTaskValidate.Text = "Task added to todays tasks";
     loadTodaysTasks(selectedDate);
 }
Exemplo n.º 13
0
 private void removeDeletedRowFromOtherTasks(object sender, DataGridViewRowCancelEventArgs e)
 {
     try
     {
         dataBase db = new dataBase();
         applicationCore ap = new applicationCore(fileNameDate);
         //get the name of the task from the deleted row and the first cell
         string deletedTaskValue = (string)dataGridView2.Rows[e.Row.Index].Cells[1].Value;
         string deletedFreqValue = (string)dataGridView2.Rows[e.Row.Index].Cells[2].Value;
         //delete rows with the same task name from other xml files
         if (deletedFreqValue == "daily")
         {
             db.delete(ap.path + fileNameDate + ".xml", "/root/tasks[task='" + deletedTaskValue + "']");
             loadTodaysTasks(selectedDate);
         }
         if (deletedFreqValue == "weekly" || deletedFreqValue == "monthly")
             for (int w = 0; w < 4; w++)
             {
                 db.delete(ap.path + @"extra\" + DateTime.Now.ToString("MMMM-yyyy") + ".xml", "/extra_tasks/extra_tasks[task='" + deletedTaskValue + "']");
             }
         loadExtraTasks();
         //now we update the table
         datasetToXml(ap.path + @"tasks/tasklist.xml", 2);
     }
     catch (Exception err)
     {
         debugTerminal terminal = new debugTerminal();
         terminal.output(err.ToString());
     }
 }
Exemplo n.º 14
0
 private void noTasks(object sender, EventArgs e)
 {
     labelNoDailyItems.Visible = false;
     buttonNoDailyTasks.Visible = false;
     dataBase db = new dataBase();
     applicationCore ap = new applicationCore(selectedDate);
     if (db.create("root", ap.path + selectedDate + ".xml"))
     {
         ap.createTodaysTasks();
         loadTodaysTasks(selectedDate);
     }
 }
Exemplo n.º 15
0
 private void noMaintenence(object sender, EventArgs e)
 {
     applicationCore ap = new applicationCore(selectedDate);
     dataBase db = new dataBase();
     if (db.create("item_maintenence", ap.path + @"maintenence\" + selectedDate + ".xml"))
     {
         ap.createTodaysTasks();
         loadAllMaintenceItems(selectedDate);
     }
     labelMaintenenceNoTasks.Visible = false;
     buttonNoMaintenenceItems.Visible = false;
 }
Exemplo n.º 16
0
 private void noContractors(object sender, EventArgs e)
 {
     dataBase db = new dataBase();
     applicationCore ap = new applicationCore(selectedDate);
     db.create("contractors_today", ap.path + @"contractors\" + selectedDate + @".xml");
     labelContractorsNoTasks.Visible = false;
     buttonNoContractors.Visible = false;
 }
Exemplo n.º 17
0
 private void addItemMaintenenceItem(object sender, EventArgs e)
 {
     try
     {
         dataBase db = new dataBase();
         applicationCore ap = new applicationCore(fileNameDate);
         ArrayList element = new ArrayList();
         //add the xml elements names
         element.Add("area");
         element.Add("room");
         element.Add("item_name");
         element.Add("description");
         element.Add("next_visit");
         ArrayList text = new ArrayList();
         text.Add(textBoxItemMaintenenceArea.Text);
         text.Add(textBoxAddItemMaintenceRoom.Text);
         text.Add(textBoxAddItemMaintenenceItem.Text);
         text.Add(richTextBoxAddItemMaintenceDescription.Text);
         text.Add(textBoxAddContractorNextVisit.Text);
         db.write(ap.path + @"maintenence\" + selectedDate + ".xml",
                         element, text, "item");
         loadAllMaintenceItems(selectedDate);
     }
     catch (Exception err)
     {
         debugTerminal terminal = new debugTerminal();
         terminal.output(err.ToString());
     }
 }
Exemplo n.º 18
0
        private void loadSelectedContractorVisits(object sender, EventArgs e)
        {
            selectedDate = this.dateTimePicker2.Value.ToString("d-MM-yyyy");
            applicationCore ap = new applicationCore(selectedDate);
            dataBase db = new dataBase();
            if (!File.Exists(ap.path + @"contractors\" + selectedDate + @".xml"))
            {
                labelContractorsNoTasks.Visible = true;
                buttonNoContractors.Visible = true;
            }
            else
            {
                selectedDate = fileNameDate;
                labelContractorsNoTasks.Visible = false;
                buttonNoContractors.Visible = false;
            }

            loadDailyContractors(selectedDate);
        }