/// <summary>
        /// used to display all the data in the database
        /// </summary>
        private void FullViewResult(string _Batch, int BoxNumber = 0)
        {
            if (string.IsNullOrEmpty(_Batch))
            {
                var barcoded = (from barcode in _Database.Barcodes
                                select new
                {
                    barcode.SequenceNumber,
                    barcode.Barcodes,
                    barcode.PrintBatch,
                    barcode.Batch
                }).ToList();


                FullView.DataSource = barcoded;
                FullView.Refresh();
            }
            else
            {
                var barcoded = (from barcode in _Database.Barcodes
                                where barcode.Batch == _Batch
                                select new
                {
                    barcode.SequenceNumber,
                    barcode.Barcodes,
                    barcode.PrintBatch,
                    barcode.Batch
                }).ToList();


                FullView.DataSource = barcoded;
                FullView.Refresh();
            }
        }
Пример #2
0
        public FullView GetFullProductsInfoCortege()
        {
            var productInfo = _context.Products.Include(c => c.BoundedWith);

            foreach (Product product in productInfo)
            {
                foreach (Product_Category pc in product.BoundedWith)
                {
                    pc.Category = _context.Categories.Find(pc.CategoryID);
                }
            }

            List <Product> lst = new List <Product>();

            foreach (Product prod in productInfo.ToList())
            {
                lst.Add(prod);
            }

            foreach (Product prod in lst)
            {
                foreach (Product_Category pc in prod.BoundedWith)
                {
                    pc.Category.BoundedWith = null;
                    pc.Product = null;
                }
            }

            //___________________________________________________
            List <ProductCortege> lstCortege = new List <ProductCortege>();
            HashSet <string>      Categories = new HashSet <string>();

            foreach (Product product in lst)
            {
                ProductCortege cortege = new ProductCortege(product.ProductName, product.Cost, product.CountInBase);
                foreach (Product_Category bound in product.BoundedWith)
                {
                    cortege.CategoryParameters.Add(bound.Category.CategoryName, bound.Strength);
                    Categories.Add(bound.Category.CategoryName);
                }
                lstCortege.Add(cortege);
            }

            FullView objectToView = new FullView()
            {
                categoryCollection = Categories, productCollection = lstCortege
            };

            return(objectToView);
            //___________________________________________________
        }
Пример #3
0
        public FullView GetFullResumesInfoCortege()
        {
            var ResumeInfo = _context.Resumes.Include(c => c.BoundedWith);

            foreach (Resume Resume in ResumeInfo)
            {
                foreach (Resume_Company pc in Resume.BoundedWith)
                {
                    pc.Company = _context.Categories.Find(pc.CompanyID);
                }
            }

            List <Resume> lst = new List <Resume>();

            foreach (Resume prod in ResumeInfo.ToList())
            {
                lst.Add(prod);
            }

            foreach (Resume prod in lst)
            {
                foreach (Resume_Company pc in prod.BoundedWith)
                {
                    pc.Company.BoundedWith = null;
                    pc.Resume = null;
                }
            }

            //___________________________________________________
            List <ResumeCortege> lstCortege = new List <ResumeCortege>();
            HashSet <string>     Categories = new HashSet <string>();

            foreach (Resume Resume in lst)
            {
                ResumeCortege cortege = new ResumeCortege(Resume.ResumeName, Resume.Salary, Resume.Age);
                foreach (Resume_Company bound in Resume.BoundedWith)
                {
                    cortege.CompanyParameters.Add(bound.Company.CompanyName, bound.Salary);
                    Categories.Add(bound.Company.CompanyName);
                }
                lstCortege.Add(cortege);
            }

            FullView objectToView = new FullView()
            {
                CompanyCollection = Categories, ResumeCollection = lstCortege
            };

            return(objectToView);
            //___________________________________________________
        }
Пример #4
0
 public IActionResult AllItems()
 {
     try
     {
         string   result       = QueryClient.SendQueryToService(HttpMethod.Get, RabbitDLL.Linker.Resumes, "/api/Resumes/full/cortege", null, null).Result;
         FullView objectToView = JsonConvert.DeserializeObject <FullView>(result);
         string   user         = HttpContext.Session.GetString("Login");
         user = user != null ? user : "";
         StatisticSender.SendStatistic("Home", DateTime.Now, "All items", Request.HttpContext.Connection.RemoteIpAddress.ToString(), true, user);
         return(View(objectToView));
     }
     catch
     {
         return(View("Error", "Service of Resumes unavailable"));
     }
 }
Пример #5
0
 public void Post([FromBody] string value)
 {
     string   result       = QueryClient.SendQueryToService(HttpMethod.Get, "http://localhost:51229", "/api/Resumes/full/cortege", null, null).Result;
     FullView objectToView = JsonConvert.DeserializeObject <FullView>(result);
 }