예제 #1
0
 public ActionResult Transactions()
 {
     var m = new Models.Home.Transactions.ViewModel();
     using (var db = new dbEntities())
     {
         var ts = db.Transactions;
         foreach (var t in ts)
         {
             var tm = new Models.Home.Transactions.TransactionModel();
             tm.EmployeeName = t.Employee.Username;
             tm.StoreName = t.Store.Location.Name;
             tm.ProductName = t.Product.Name;
             tm.Quantity = t.Quantity;
             tm.Timestamp = t.Timestamp;
             m.Transactions.Add(tm);
         }
     }
     return View(m);
 }
예제 #2
0
        public ActionResult Transactions()
        {
            var m = new Models.Home.Transactions.ViewModel();

            using (var db = new dbEntities())
            {
                var ts = db.Transactions;
                foreach (var t in ts)
                {
                    var tm = new Models.Home.Transactions.TransactionModel();
                    tm.EmployeeName = t.Employee.Username;
                    tm.StoreName    = t.Store.Location.Name;
                    tm.ProductName  = t.Product.Name;
                    tm.Quantity     = t.Quantity;
                    tm.Timestamp    = t.Timestamp;
                    m.Transactions.Add(tm);
                }
            }
            return(View(m));
        }