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); }
public UnitOfWork() { this._context = new REERPContext(); }
public UnitOfWork(ILog log) { this._context = new REERPContext(); _log = log; }
public GenericRepository(REERPContext context) { _context = context; }