示例#1
0
 private void FormPutOnStock_Load(object sender, EventArgs e)
 {
     try
     {
         List <ComponentView> listC = serviceC.GetList();
         if (listC != null)
         {
             comboBoxComponent.DisplayMember = "IngridientName";
             comboBoxComponent.ValueMember   = "Id";
             comboBoxComponent.DataSource    = listC;
             comboBoxComponent.SelectedItem  = null;
         }
         List <StorageView> listS = serviceS.GetList();
         if (listS != null)
         {
             comboBoxStock.DisplayMember = "StorageName";
             comboBoxStock.ValueMember   = "Id";
             comboBoxStock.DataSource    = listS;
             comboBoxStock.SelectedItem  = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
 private void LoadData()
 {
     try
     {
         List <ComponentView> list = service.GetList();
         if (list != null)
         {
             dataGridView.DataSource              = list;
             dataGridView.Columns[0].Visible      = false;
             dataGridView.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
 private void FormProductComponent_Load(object sender, EventArgs e)
 {
     try
     {
         List <ComponentView> list = service.GetList();
         if (list != null)
         {
             comboBoxComponent.DisplayMember = "IngridientName";
             comboBoxComponent.ValueMember   = "Id";
             comboBoxComponent.DataSource    = list;
             comboBoxComponent.SelectedItem  = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     if (model != null)
     {
         comboBoxComponent.Enabled       = false;
         comboBoxComponent.SelectedValue = model.IngridientId;
         textBoxCount.Text = model.Count.ToString();
     }
 }