예제 #1
0
 private void GetPage()
 {
     try
     {
         var list = logic.Read(limit, offset);
         if (list.Count != 0)
         {
             dataGridView.DataSource = list;
             int totalRowHeight = dataGridView.ColumnHeadersHeight;
             foreach (DataGridViewRow row in dataGridView.Rows)
             {
                 totalRowHeight += row.Height;
             }
             dataGridView.Height                  = totalRowHeight;
             dataGridView.Columns[0].Visible      = false;
             dataGridView.Columns[1].Width        = 150;
             dataGridView.Columns[2].Width        = 150;
             dataGridView.Columns[3].Width        = 150;
             dataGridView.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
             dataGridView.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
             dataGridView.Columns[6].Visible      = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
        private void FormSpecialistService_Load(object sender, EventArgs e)
        {
            List <ServiceViewModel> services = serviceLogic.Read(null, null);

            if (services != null)
            {
                comboBoxService.DisplayMember = "ServiceName";
                comboBoxService.ValueMember   = "Id";
                comboBoxService.DataSource    = services;
                comboBoxService.SelectedItem  = null;
            }
            List <SpecialistViewModel> specialists = specialistLogic.Read(null, null);

            if (specialists != null)
            {
                comboBoxSpecialist.DisplayMember = "FirstName";
                comboBoxSpecialist.ValueMember   = "Id";
                comboBoxSpecialist.DataSource    = specialists;
                comboBoxSpecialist.SelectedItem  = null;
            }
        }
예제 #3
0
 private void FormSpecialist_Load(object sender, EventArgs e)
 {
     try
     {
         if (id.HasValue)
         {
             var view = logic.Read(new SpecialistBindingModel {
                 Id = id.Value
             });
             if (view != null)
             {
                 textBoxLastName.Text       = view.Lastname;
                 textBoxFirstName.Text      = view.Firstname;
                 textBoxMiddleName.Text     = view.Middlename;
                 textBoxExperienceWork.Text = view.ExperienceWork.ToString();
                 textBoxQualification.Text  = view.Qualification;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }