Esempio n. 1
0
        private void OpenCompany()
        {
            SelectedCompany = CompanyGoodsList.FirstOrDefault(cgl => cgl.company.name == SelectedCompanyAndGoods.companyName);

            var companyViewModel = new CompanyViewModel(SelectedCompany.company)
            {
                Description = "Компания " + SelectedCompany.company.name.Replace("Товарищество с ограниченной ответственностью", "ТОО")
            };

            var companyView = new CompanyView();

            companyViewModel.View = companyView;

            Workspace.This.Panels.Add(companyViewModel);
            Workspace.This.ActiveDocument = companyViewModel;
        }
Esempio n. 2
0
        private void Search()
        {
            if (!string.IsNullOrEmpty(SearchTxt))
            {
                CompanyGoodsList = dataManager.GetCompaniesWithProduct(SearchTxt);

                if (CompanyGoodsList != null && CompanyGoodsList.Count > 0)
                {
                    CompanyAndGoods = new List <vm.CompanyAndGoods>();
                    List <ProductCompanyEF> productCompany = new List <ProductCompanyEF>();

                    foreach (var item in CompanyGoodsList)
                    {
                        if (item.company != null)
                        {
                            productCompany.Add(item);
                        }
                    }

                    CompanyGoodsList = productCompany;

                    var goods = CompanyGoodsList.GroupBy(c => c.company.name);

                    foreach (IGrouping <string, ProductCompanyEF> g in goods)
                    {
                        CompanyAndGoods cag = new vm.CompanyAndGoods();
                        cag.companyName = g.Key;

                        foreach (var t in g)
                        {
                            cag.result += t.name + ", ";
                        }

                        CompanyAndGoods.Add(cag);
                    }
                }
            }
        }