public List <SellerModel> SellerInfo()
        {
            List <SellerModel> sellerList = new List <SellerModel>();
            var fileSellers = GetFilesDirectoryService.SellerFiles();

            foreach (var seller in fileSellers)
            {
                String[] sellerData = seller.ToString().Split(new string[] { "ç" }, StringSplitOptions.None);

                sellerList.Add(new SellerModel
                {
                    SellerName = sellerData[2].ToString(),
                    CPF        = sellerData[1].ToString(),
                    Salary     = float.Parse(sellerData[3], CultureInfo.InvariantCulture.NumberFormat)
                });
            }

            return(sellerList);
        }
Ejemplo n.º 2
0
        public List <ClientModel> ClientInfo()
        {
            List <ClientModel> clientList = new List <ClientModel>();
            var fileClients = GetFilesDirectoryService.ClientFiles();

            foreach (var client in fileClients)
            {
                String[] clientData = client.ToString().Split(new string[] { "ç" }, StringSplitOptions.None);

                clientList.Add(new ClientModel
                {
                    ClientName   = clientData[2].ToString(),
                    CNPJ         = clientData[1].ToString(),
                    BussinesArea = clientData[3].ToString()
                });
            }

            return(clientList);
        }
Ejemplo n.º 3
0
        public List <SaleModel> SaleInfo()
        {
            List <SaleModel>          saleList = new List <SaleModel>();
            List <SaleOrderItemModel> items    = new List <SaleOrderItemModel>();
            var fileSales = GetFilesDirectoryService.SaleFiles();

            foreach (var sale in fileSales)
            {
                String[] saleData  = sale.ToString().Split(new string[] { "ç", "[", "]" }, StringSplitOptions.None);
                var      saleItens = GetItems(saleData[3].ToString().Split(new string[] { "," }, StringSplitOptions.None));
                var      sum       = SumItems(saleItens);
                saleList.Add(new SaleModel
                {
                    OrderId    = int.Parse(saleData[1]),
                    SellerName = saleData[5],
                    SaleItems  = saleItens,
                    SumSales   = sum
                });
            }

            return(saleList);
        }