コード例 #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);
            }
        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #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);
        }