Ejemplo n.º 1
0
        public TransactionViewModel(Transaction transaction)
        {
            ID    = transaction.ID;
            Type  = (TranType)transaction.TypeID;
            Price = transaction.Price;
            Date  = transaction.Date;

            var product = transaction.Product;

            if (product != null)
            {
                ProductID    = product.ID;
                ModelName    = product.Model.Name;
                CategoryName = product.Model.Category.Name;
                SerialNumber = product.SerialNumber;
            }

            if (transaction.Operator != null)
            {
                Salesman = new SalesmanViewModel(transaction.Operator.Salesman);
            }
            if (transaction.Contragent != null)
            {
                ContragentLastName = new ContragentViewModel(transaction.Contragent);
            }
        }
Ejemplo n.º 2
0
 public CashTransactionViewModel(Transaction transaction)
 {
     ID = transaction.ID;
     Date = transaction.Date;
     CashTranType = (TranType) transaction.TypeID;
     Salesman = new SalesmanViewModel(transaction.Operator.Salesman);
     if (transaction.Contragent != null) Contragent = new ContragentViewModel(transaction.Contragent);
     if (transaction.Price != null) Price = transaction.Price.Value;
     Notes = transaction.Notes;
 }
Ejemplo n.º 3
0
 public CashTransactionViewModel(Transaction transaction)
 {
     ID           = transaction.ID;
     Date         = transaction.Date;
     CashTranType = (TranType)transaction.TypeID;
     Salesman     = new SalesmanViewModel(transaction.Operator.Salesman);
     if (transaction.Contragent != null)
     {
         Contragent = new ContragentViewModel(transaction.Contragent);
     }
     if (transaction.Price != null)
     {
         Price = transaction.Price.Value;
     }
     Notes = transaction.Notes;
 }
Ejemplo n.º 4
0
        public TransactionViewModel(Transaction transaction)
        {
            ID = transaction.ID;
            Type = (TranType)transaction.TypeID;
            Price = transaction.Price;
            Date = transaction.Date;

            var product = transaction.Product;
            if (product != null)
            {
                ProductID = product.ID;
                ModelName = product.Model.Name;
                CategoryName = product.Model.Category.Name;
                SerialNumber = product.SerialNumber;
            }

            if (transaction.Operator != null) Salesman = new SalesmanViewModel(transaction.Operator.Salesman);
            if (transaction.Contragent != null) ContragentLastName = new ContragentViewModel(transaction.Contragent);
        }