private void fillTable()
        {
            reports = (List <Report>)getReportstsList();
            List <int> workshops = new List <int>();

            foreach (var report in reports)
            {
                workshops.Add(report.workshop_sender_pk);
            }
            List <Workshop> workshopsModels = (List <Workshop>)ApiConnector.getWorkshops(workshops);

            if (reportsGrid.InvokeRequired)
            {
                reportsGrid.Invoke(new MethodInvoker(delegate
                {
                    foreach (var report in (List <Report>)reports)
                    {
                        reportsGrid.Rows.Add(report.doc_num, report.date, workshopsModels.Find(workshop => workshop.workshop_pk == report.workshop_sender_pk).workshop_name);
                    }

                    AutoCompleteSourceForDocNum.Clear();
                    foreach (Report report in reports)
                    {
                        AutoCompleteSourceForDocNum.Add(report.doc_num.ToString());
                    }
                    finishThread();
                }));
            }
        }
Exemplo n.º 2
0
        private void fillTable()
        {
            vedomosts = (List <Vedomost>)getVedomostsList();
            if (inventarizationTable.InvokeRequired)
            {
                inventarizationTable.Invoke(new MethodInvoker(delegate
                {
                    foreach (var vedomost in (List <Vedomost>)vedomosts)
                    {
                        inventarizationTable.Rows.Add(vedomost.doc_num, vedomost.creation_date);
                    }

                    AutoCompleteSourceForDocNum.Clear();
                    foreach (Vedomost vedomost in vedomosts)
                    {
                        AutoCompleteSourceForDocNum.Add(vedomost.doc_num.ToString());
                    }
                    finishThread();
                }));
            }
        }