Ejemplo n.º 1
0
        public List <StockViewModel> GetReportStatusByBranch(int branchId)
        {
            var stockStatus = new List <StockViewModel>();

            using (var context = new REERPContext())
            {
                stockStatus = (from s in context.Stocks
                               where s.Quantity > 0 && s.BranchId == branchId
                               select new StockViewModel
                {
                    BranchName = s.Branch.BranchName,
                    CategoryName = s.Productc.Category.CategoryName,
                    ProductId = s.ProductcId,
                    ProductName = s.Productc.ProductName,
                    UnitOfMeasure = s.Productc.UnitOfMeasure,
                    UnitCost = s.Productc.UnitCost,
                    TotalCost = s.Quantity * s.Productc.UnitCost,
                }).ToList <StockViewModel>();
            }
            return(stockStatus);
        }
Ejemplo n.º 2
0
 public UnitOfWork()
 {
     this._context = new REERPContext();
 }
Ejemplo n.º 3
0
 public UnitOfWork(ILog log)
 {
     this._context = new REERPContext();
     _log          = log;
 }
Ejemplo n.º 4
0
 public GenericRepository(REERPContext context)
 {
     _context = context;
 }