Exemple #1
0
        public override void UpdateByDoing(string ID, long statuses)
        {
            RecordData rData   = new RecordData();
            long       Current = 0;

            if (rData.CountOfCurrent(ID) > 0)
            {
                Current = rData.SumOfCurrent(ID);
            }
            if (Current > getGoal(ID))
            {
                base.UpdateByDoing(ID, statuses);
            }
        }
Exemple #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.");
        }