Ejemplo n.º 1
0
        private void TypeCbBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox input = (ComboBox)sender;

            try
            {
                if (input.SelectedValue == null)
                {
                    MessageBox.Show("Chưa có công việc loại này");
                }
                HideAll();
                switch ((long)input.SelectedValue)
                {
                case (long)ThingsToDo.types.Daily:
                    cursor = dData;
                    break;

                case (long)ThingsToDo.types.Event:
                    cursor = eData;
                    break;

                case (long)ThingsToDo.types.Objective:
                    cursor = oData;
                    LoadOpjective();
                    break;

                case (long)ThingsToDo.types.Project:
                    cursor = pData;
                    LoadProject();
                    break;
                }

                Namedt = cursor.ReadDataTableForDoing();
                //NameCbBox.DataSource = null;
                NameCbBox.DataSource    = Namedt;
                NameCbBox.DisplayMember = "Name";
                NameCbBox.ValueMember   = "ID";
                NameCbBox.Text          = "";
                if (Namedt.Rows.Count == 0)
                {
                    CurrentLbl.Hide();
                    ValueGoal_DeadlineLbl.Hide();
                    Goal_DeadlineLbl.Hide();
                }
            }
            catch (Exception ex)
            {
                HideAll();
            }
        }
Ejemplo n.º 2
0
 public DoingThings()
 {
     timeComponent = new TimeComponent()
     {
         Location = new Point(12, 100)
     };
     typedata = new TypeData();
     ttdData  = new ThingsToDoData();
     eData    = new EventData();
     dData    = new DailyData();
     pData    = new ProjectData();
     oData    = new ObjectiveData();
     InitializeComponent();
     panelControlGenneral.Controls.Add(timeComponent);
     CurrentTxtBox.KeyPress        += Default.OnlyNumberPress;
     TypeCbBox.DataSource           = typedata.ReadDataTable();
     TypeCbBox.DisplayMember        = "Name";
     TypeCbBox.ValueMember          = "ID";
     TypeCbBox.SelectedIndex        = 1;
     panelControlGenneral.BackColor = Default.color;
 }