private void FormMainK_Load(object sender, EventArgs e) { try { List <ProductBM> list = _serviceP.GetList(); if (list != null) { F_GoodsList.DataSource = list; F_GoodsList.Columns[0].Visible = false; // F_GoodsList.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { List <ProductGroupBM> list = _servicePG.GetListComboBox(); if (list != null) { F_ChooseGrop.DisplayMember = "Name"; F_ChooseGrop.ValueMember = "Id"; F_ChooseGrop.DataSource = list; F_ChooseGrop.SelectedItem = null; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void newProduct_Load(object sender, EventArgs e) { try { List <ProductGroupBM> list = _servicePG.GetListComboBox(); if (list != null) { F_Group.DisplayMember = "Name"; F_Group.ValueMember = "Id"; F_Group.DataSource = list; F_Group.SelectedItem = null; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } /*редактирование * if (model != null) * { * comboBox1.Enabled = false; * comboBox1.SelectedValue = model.IngredientId; * FCINumber.Text = model.Count.ToString(); * }*/ }
private void FormRevGroup_Load(object sender, EventArgs e) { try { List <ProductGroupBM> list = _servicePG.GetListComboBox(); if (list != null) { F_Group.DisplayMember = "Name"; F_Group.ValueMember = "Id"; F_Group.DataSource = list; F_Group.SelectedItem = null; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } ProductWaybills = new List <ProductWaybillBM>(); }