예제 #1
0
 private void UpdateDailyBtn_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in DailyDataGrid.Rows)
     {
         if ((long)row.Cells["DONE"].Value == 0)
         {
             Ddata.UpdateStatusByID(row.Cells["ID"].Value.ToString(), (long)row.Cells["DONE"].Value);
             RData.Insert(new Record(Convert.ToInt32(row.Cells["ID"].Value.ToString()), DateTime.Now, 0));
         }
     }
 }
예제 #2
0
        private void DoneBtn_Click(object sender, EventArgs e)
        {
            if (CheckRequirement())
            {
                RecordData Rdata = new RecordData();

                switch ((long)TypeCbBox.SelectedValue)
                {
                default:
                    Rdata.Insert(new Record()
                    {
                        TTD_ID = (long)NameCbBox.SelectedValue, Date = DateTime.Now.Date, Current = 0
                    });
                    break;

                case (long)ThingsToDo.types.Project:
                    pData.HasPlanChecked((long)NameCbBox.SelectedValue, HasPlanChkBox.Checked);
                    Rdata.Insert(new Record()
                    {
                        TTD_ID = (long)NameCbBox.SelectedValue, Date = DateTime.Now.Date, Current = Convert.ToInt32(CurrentTxtBox.Text)
                    });
                    break;

                case (long)ThingsToDo.types.Objective:
                    Rdata.Insert(new Record()
                    {
                        TTD_ID = (long)NameCbBox.SelectedValue, Date = DateTime.Now.Date, Current = Convert.ToInt32(CurrentTxtBox.Text)
                    });
                    break;
                }
                this.Close();
                cursor.UpdateByDoing(NameCbBox.SelectedValue.ToString(), (long)ThingsToDo.statuses.Done);
                return;
            }
            MessageBox.Show("bạn chưa điền đủ thông tin.");
        }