示例#1
0
        public NeoHomePage()
        {
            InitializeComponent();

            // Dagens datum
            dateNow = DateTime.Now.ToString("yyyy-M-dd");

            // Datum -35
            string[] date = funcObject.splitDate(funcObject.getDateByStartDatePlusInterval(dateNow, interval, "yyyy-MM-dd"));
            fromDatePicker.Value = new DateTime(int.Parse(date[0]), int.Parse(date[1]), int.Parse(date[2]));

            // Räkna ut
            countCallings();
        }
示例#2
0
        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            if (selectedPersonId == null)
            {
                MessageBox.Show("Välj först ett barn från listan nedan.", "Fel");
            }
            else
            {
                // Kontroll
                Boolean control = false;

                // Hämta in data.
                var child = dbOject.executeDbQuery("select * from Children where person_id = '" + selectedPersonId + "'");
                if (child.Rows.Count > 0)
                {
                    control = true;
                }
                else
                {
                    string personNr = selectedPersonId.Insert(6, "-");
                    child = dbOject.executeDbQuery("select * from Children where person_id = '" + personNr + "'");
                    if (child.Rows.Count > 0)
                    {
                        control = true;
                    }
                }

                // Om det finns ett bra visa
                if (control == true)
                {
                    DataRow childDr = child.Rows[child.Rows.Count - 1];

                    // Skapa objekt för klassen funkton
                    functions funcObject = new functions();

                    MessageBox.Show(childDr["first_name"].ToString() + " " + childDr["last_name"].ToString()
                                    + "\nStatus: " + funcObject.translateStatusCode(int.Parse(childDr["status"].ToString()))
                                    + "\n\n2 Månader: " + funcObject.getDateByStartDatePlusInterval(childDr["planned_birthday"].ToString(), 61, "yyyy-MM-dd")
                                    + "\n5-6 Månader: " + funcObject.getDateByStartDatePlusInterval(childDr["planned_birthday"].ToString(), 183, "yyyy-MM-dd")
                                    + "\n10-12 Månader: " + funcObject.getDateByStartDatePlusInterval(childDr["planned_birthday"].ToString(), 365, "yyyy-MM-dd")
                                    + "\n18-20 Månader: " + funcObject.getDateByStartDatePlusInterval(childDr["planned_birthday"].ToString(), 610, "yyyy-MM-dd")
                                    + "\n2 år: " + funcObject.getDateByStartDatePlusInterval(childDr["planned_birthday"].ToString(), 730, "yyyy-MM-dd")
                                    + "\n5 år: " + funcObject.getDateByStartDatePlusInterval(childDr["planned_birthday"].ToString(), 2013, "yyyy-MM-dd"), "Detaljer");
                }
            }
        }