Exemplo n.º 1
0
        public FinishTaskForm(TaskModel task)
        {
            db          = new MyDbConnection();
            taskId      = task.Id;
            newStatusId = ++task.Status.Id;
            List <StatusModel> statuses  = db.GetStatuses();
            StatusModel        newStatus = statuses.FirstOrDefault(x => x.Id == newStatusId);

            if (newStatus == null)
            {
                this.Opacity = 0;
                MessageBox.Show("Błąd podczas wyznaczania nowego statusu!", "Błąd.");
                this.Close();
                return;
            }

            InitializeComponent();
            labelTaskManufacturer.Text = task.BikeManufacturer;
            labelTaskModel.Text        = task.BikeModel;
            labelTaskPhone.Text        = task.PhoneNumber;
            labelTaskStatus.Text       = newStatus.Value;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Loads all possible statuses and loads them to ComboBox inside a form.
 /// </summary>
 private void InitializeStatuses()
 {
     statuses            = db.GetStatuses();
     bsStatus.DataSource = statuses;
 }