Esempio n. 1
0
        private void SaveActivity_Button_Click(object sender, EventArgs e)
        {
            HEADERTEXT   = NewActivityHeaderTextBox.Text;
            SUMMARYTEXT  = NewActivitySummaryTextBox.Text;
            LEADERTEXT   = NewActivityLeadersTextBox.Text;
            INSERTERTEXT = NewActivityInserterTextBox.Text;
            //StartDateTime = StartDatePicker.Value.Date + StartTimePicker.Value.TimeOfDay;
            StartDateTime = StartDatePicker.Value.ToString("yyyy-MM-dd HH:mm:ss");
            //EndDateTime = EndDatePicker.Value.Date + EndTimePicker.Value.TimeOfDay;
            EndDateTime = StartDatePicker.Value.ToString("yyyy-MM-dd HH:mm:ss");
            STARTED     = 'Y';
            PAUSED      = 'N';
            STOPPED     = 'N';
            Console.WriteLine(StartDatePicker.Value.ToString("yyyy - MM - dd"));
            DialogResult result;

            result = MessageBox.Show("וודא שפרטי הפעילות נכונים, אם אכן כך, בחר ב'OK'", "וודא אמיתות הפרטים", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            if (result == DialogResult.Cancel)
            {
                return;
            }
            else
            {
                newactivity = DataBaseQueries.Insert(HEADERTEXT, SUMMARYTEXT, SEVERITYLEVEL, INSERTERTEXT, LEADERTEXT, StartDateTime, EndDateTime, STARTED, PAUSED, STOPPED);
                this.Close();
            }
        }
Esempio n. 2
0
 public New_Activity()
 {
     InitializeComponent();
     DataBaseQueries.InitializeDB();
     Console.WriteLine(StartDatePicker.Value.ToString("yyyy-MM-dd"));
     Console.WriteLine(StartDatePicker.Value.ToString("HH:mm:ss"));
     Console.WriteLine(StartDatePicker.Value.ToString("yyyy-MM-dd HH:mm:ss"));
 }
Esempio n. 3
0
        public void updateActivities()
        {
            List <string> activitiesID = DataBaseQueries.GetActivitiesID();

            startedActivitiesCount = activitiesID.Count;

            switch (this.startedActivitiesCount)
            {
            case 0:
                Activity1Panel.Visible          = false;
                Activity1AddImageButton.Visible = true;
                Activity2Panel.Visible          = false;
                Activity2AddImageButton.Visible = true;
                Activity3Panel.Visible          = false;
                Activity3AddImageButton.Visible = true;
                Activity4Panel.Visible          = false;
                Activity4AddImageButton.Visible = true;
                break;

            case 1:
                Activity1Panel.Visible          = true;
                Activity1AddImageButton.Visible = false;
                Activity2Panel.Visible          = false;
                Activity2AddImageButton.Visible = true;
                Activity3Panel.Visible          = false;
                Activity3AddImageButton.Visible = true;
                Activity4Panel.Visible          = false;
                Activity4AddImageButton.Visible = true;
                activities                 = DataBaseQueries.getActivities();
                Activity1Header.Text       = activities[0].header;
                Activity1Summary.Text      = activities[0].summary;
                Leaders1TextBox.Text       = activities[0].leaders;
                Inserter1TextBox.Text      = activities[0].inserter;
                Severity1TextBox.Text      = activities[0].severity.ToString();
                ID1TextBox.Text            = activities[0].ID.ToString();
                StartDateTime1TextBox.Text = activities[0].StartDateTime.ToString();
                EndDateTime1TextBox.Text   = activities[0].EndDateTime.ToString();
                break;

            case 2:
                Activity1Panel.Visible          = true;
                Activity1AddImageButton.Visible = false;
                Activity2Panel.Visible          = true;
                Activity2AddImageButton.Visible = false;
                Activity3Panel.Visible          = false;
                Activity3AddImageButton.Visible = true;
                Activity4Panel.Visible          = false;
                Activity4AddImageButton.Visible = true;
                activities = DataBaseQueries.getActivities();

                Activity1Header.Text       = activities[0].header;
                Activity1Summary.Text      = activities[0].summary;
                Leaders1TextBox.Text       = activities[0].leaders;
                Severity1TextBox.Text      = activities[0].severity.ToString();
                Inserter1TextBox.Text      = activities[0].inserter;
                ID1TextBox.Text            = activities[0].ID.ToString();
                StartDateTime1TextBox.Text = activities[0].StartDateTime.ToString();
                EndDateTime1TextBox.Text   = activities[0].EndDateTime.ToString();

                Activity2Header.Text       = activities[1].header;
                Activity2Summary.Text      = activities[1].summary;
                Leaders2TextBox.Text       = activities[1].leaders;
                Severity2TextBox.Text      = activities[1].severity.ToString();
                Inserter2TextBox.Text      = activities[1].inserter;
                ID2TextBox.Text            = activities[1].ID.ToString();
                StartDateTime2TextBox.Text = activities[1].StartDateTime.ToString();
                EndDateTime2TextBox.Text   = activities[1].EndDateTime.ToString();
                break;

            case 3:
                Activity1Panel.Visible          = true;
                Activity1AddImageButton.Visible = false;
                Activity2Panel.Visible          = true;
                Activity2AddImageButton.Visible = false;
                Activity3Panel.Visible          = true;
                Activity3AddImageButton.Visible = false;
                Activity4Panel.Visible          = false;
                Activity4AddImageButton.Visible = true;
                activities                 = DataBaseQueries.getActivities();
                Activity1Header.Text       = activities[0].header;
                Activity1Summary.Text      = activities[0].summary;
                Leaders1TextBox.Text       = activities[0].leaders;
                Severity1TextBox.Text      = activities[0].severity.ToString();
                Inserter1TextBox.Text      = activities[0].inserter;
                ID1TextBox.Text            = activities[0].ID.ToString();
                StartDateTime1TextBox.Text = activities[0].StartDateTime.ToString();
                EndDateTime1TextBox.Text   = activities[0].EndDateTime.ToString();

                Activity2Header.Text       = activities[1].header;
                Activity2Summary.Text      = activities[1].summary;
                Leaders2TextBox.Text       = activities[1].leaders;
                Severity2TextBox.Text      = activities[1].severity.ToString();
                Inserter2TextBox.Text      = activities[1].inserter;
                ID2TextBox.Text            = activities[1].ID.ToString();
                StartDateTime2TextBox.Text = activities[1].StartDateTime.ToString();
                EndDateTime2TextBox.Text   = activities[1].EndDateTime.ToString();

                Activity3Header.Text       = activities[2].header;
                Activity3Summary.Text      = activities[2].summary;
                Leaders3TextBox.Text       = activities[2].leaders;
                Severity3TextBox.Text      = activities[2].severity.ToString();
                Inserter3TextBox.Text      = activities[2].inserter;
                ID3TextBox.Text            = activities[2].ID.ToString();
                StartDateTime3TextBox.Text = activities[2].StartDateTime.ToString();
                EndDateTime3TextBox.Text   = activities[2].EndDateTime.ToString();
                break;

            case 4:
                Activity1Panel.Visible          = true;
                Activity1AddImageButton.Visible = false;
                Activity2Panel.Visible          = true;
                Activity2AddImageButton.Visible = false;
                Activity3Panel.Visible          = true;
                Activity3AddImageButton.Visible = false;
                Activity4Panel.Visible          = true;
                Activity4AddImageButton.Visible = false;
                activities                 = DataBaseQueries.getActivities();
                Activity1Header.Text       = activities[0].header;
                Activity1Summary.Text      = activities[0].summary;
                Leaders1TextBox.Text       = activities[0].leaders;
                Severity1TextBox.Text      = activities[0].severity.ToString();
                Inserter1TextBox.Text      = activities[0].inserter;
                ID1TextBox.Text            = activities[0].ID.ToString();
                StartDateTime1TextBox.Text = activities[0].StartDateTime.ToString();
                EndDateTime1TextBox.Text   = activities[0].EndDateTime.ToString();

                Activity2Header.Text       = activities[1].header;
                Activity2Summary.Text      = activities[1].summary;
                Leaders2TextBox.Text       = activities[1].leaders;
                Severity2TextBox.Text      = activities[1].severity.ToString();
                Inserter2TextBox.Text      = activities[1].inserter;
                ID2TextBox.Text            = activities[1].ID.ToString();
                StartDateTime2TextBox.Text = activities[1].StartDateTime.ToString();
                EndDateTime2TextBox.Text   = activities[1].EndDateTime.ToString();

                Activity3Header.Text       = activities[2].header;
                Activity3Summary.Text      = activities[2].summary;
                Leaders3TextBox.Text       = activities[2].leaders;
                Severity3TextBox.Text      = activities[2].severity.ToString();
                Inserter3TextBox.Text      = activities[2].inserter;
                ID3TextBox.Text            = activities[2].ID.ToString();
                StartDateTime3TextBox.Text = activities[2].StartDateTime.ToString();
                EndDateTime3TextBox.Text   = activities[2].EndDateTime.ToString();

                Activity4Header.Text       = activities[3].header;
                Activity4Summary.Text      = activities[3].summary;
                Leaders4TextBox.Text       = activities[3].leaders;
                Severity4TextBox.Text      = activities[3].severity.ToString();
                Inserter4TextBox.Text      = activities[3].inserter;
                ID4TextBox.Text            = activities[3].ID.ToString();
                StartDateTime4TextBox.Text = activities[3].StartDateTime.ToString();
                EndDateTime4TextBox.Text   = activities[3].EndDateTime.ToString();
                break;

            default:
                Activity1Panel.Visible          = false;
                Activity1AddImageButton.Visible = true;
                Activity2Panel.Visible          = false;
                Activity2AddImageButton.Visible = true;
                Activity3Panel.Visible          = false;
                Activity3AddImageButton.Visible = true;
                Activity4Panel.Visible          = false;
                Activity4AddImageButton.Visible = true;
                activities = DataBaseQueries.getActivities();
                break;
            }
        }
Esempio n. 4
0
 public Page_Menu()
 {
     InitializeComponent();
     DataBaseQueries.InitializeDB();
     updateActivities();
 }