コード例 #1
0
ファイル: Form1.cs プロジェクト: csravuri/TimeSheet
        private void endButton_Click(object sender, EventArgs e)
        {
            string taskID     = this.taskIDTextBox.Text;
            string taskName   = this.taskNameComboBox.Text;
            string clientName = this.clientNameComboBox.Text;
            string isCoded    = this.codingCheckBox.Checked ? "1" : "0";
            string isReviewd  = this.reviewCheckBox.Checked ? "1" : "0";
            string isCheckin  = this.checkinCheckBox.Checked ? "1" : "0";
            string endTime    = DateTime.Now.TimeOfDay.ToString();
            string comment    = this.commentTextBox.Text == "" ? null : this.commentTextBox.Text;

            DbTransaction dbTransaction = new DbTransaction();

            dbTransaction.TaskEnded(taskID, taskName, clientName, isCoded, isReviewd, isCheckin, endTime, comment);

            this.durationValue.Text = excelWriter.GetStandardTimeFormat(excelWriter.GetTimeDifference(this.startTimeValue.Text, endTime));
            dbTransaction.AddNonExistingClient(clientName);
            this.endButton.Enabled   = false;
            this.startButton.Enabled = true;
            ExportButton_Enable();
            ClearForNewTask();
            EnableTextBoxes();
            this.ActiveControl = this.taskIDTextBox;

            FillClientListDropDown();
            FillTaskNameDropDown();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: csravuri/TimeSheet
        private void startButton_Click(object sender, EventArgs e)
        {
            ClearTimeValues();
            if (ValidateDetails())
            {
                string taskID     = this.taskIDTextBox.Text;
                string taskName   = this.taskNameComboBox.Text;
                string clientName = this.clientNameComboBox.Text;
                string taskDate   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                string isCoded    = this.codingCheckBox.Checked ? "1" : "0";
                string isReviewd  = this.reviewCheckBox.Checked ? "1" : "0";
                string isCheckin  = this.checkinCheckBox.Checked ? "1" : "0";
                string startTime  = DateTime.Now.TimeOfDay.ToString();
                string comment    = this.commentTextBox.Text == "" ? null : this.commentTextBox.Text;

                DbTransaction dbTransaction = new DbTransaction();


                dbTransaction.TaskStarted(taskID, taskName, clientName, isCoded, isReviewd, isCheckin, taskDate, startTime, comment: comment);

                DisableTextBoxes();
                dbTransaction.AddNonExistingClient(clientName);
                ExportButton_Disable();
                this.startButton.Enabled = false;
                this.endButton.Enabled   = true;
                this.startTimeValue.Text = excelWriter.GetStandardTimeFormat(startTime);
                this.WindowState         = FormWindowState.Minimized;
            }
            else
            {
                this.errorMessageLabel.ForeColor = Color.Red;
                this.errorMessageLabel.Text      = "Please enter Task Name";
            }
        }