private void FormCreateOrder_Load(object sender, EventArgs e)
        {
            try
            {
                var list = logicP.Read(null);
                if (list != null)
                {
                    comboBoxKomlect.DataSource    = list;
                    comboBoxKomlect.DisplayMember = "KomlectName";
                    comboBoxKomlect.ValueMember   = "Id";
                    comboBoxKomlect.SelectedItem  = null;
                }

                var listC = logicC.Read(null);

                if (listC != null)
                {
                    comboBoxClient.DisplayMember = "ClientFIO";
                    comboBoxClient.ValueMember   = "Id";
                    comboBoxClient.DataSource    = listC;
                    comboBoxClient.SelectedItem  = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Получение списка компонент с указанием, в каких изделиях используются
        /// </summary>
        /// <returns></returns>
        public List <ReportKomlectComponentViewModel> GetKomlectComponent()
        {
            var Komlects = KomlectLogic.Read(null);
            var list     = new List <ReportKomlectComponentViewModel>();

            foreach (var Komlect in Komlects)
            {
                foreach (var rec in Komlect.KomlectComponents)
                {
                    var record = new ReportKomlectComponentViewModel
                    {
                        KomlectName   = Komlect.KomlectName,
                        ComponentName = rec.Value.Item1,
                        TotalCount    = rec.Value.Item2
                    };
                    list.Add(record);
                }
            }
            return(list);
        }
Esempio n. 3
0
 private void LoadData()
 {
     try
     {
         Program.ConfigGrid(logic.Read(null), dataGridView);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
 [HttpGet] public List <KomlectModel> GetProductList() => _product.Read(null)?.Select(rec => Convert(rec)).ToList();