Example #1
0
        public SaleInfo ParseRecord(Record record)
        {
            string[] strings = record.Client.Split(' ');

            DateTime date = record.Date;

            DAL.Models.FileInformation fileInformation = null;
            Client  client  = null;
            Product product = new Product(record.Product);
            decimal cost    = record.Cost;

            switch (strings.Length)
            {
            case 1:
                client = new Client("", strings[0]);
                break;

            case 2:
                client = new Client(strings[0], strings[1]);
                break;
            }


            return(new SaleInfo(date, fileInformation, client, product, cost));
        }
Example #2
0
 public SaleInfo(DateTime date, FileInformation fileInformation, Client client, Product product, decimal cost)
 {
     this.Date = date;
     this.FileInformation = fileInformation;
     this.Client = client;
     this.Product = product;
     this.Cost = cost;
 }
Example #3
0
 public SaleInfo(int id, DateTime date, FileInformation fileInformation, Client client, Product product, decimal cost)
     : this(date, fileInformation, client, product, cost)
 {
     this.Id = id;
 }
Example #4
0
 public SaleInfo(int id, DateTime date, FileInformation fileInformation, Client client, Product product, decimal cost)
     : this(date, fileInformation, client, product, cost)
 {
     this.Id = id;
 }