public void ReportViewControllerCreateTest() { var controller = new ReportViewController(); var result = controller.Create() as ViewResult; Assert.AreEqual("", result.ViewName); }
private void GetBillList() { using (SpareEntities db = EntitiesFactory.CreateSpareInstance()) { _billList = ReportViewController.GetIoSummarysByStockDetailList(db, _beginTime, _endTime); dgvBill.DataSource = ListHelper.ListToDataTable(_billList); } }
private void GetBillList() { using (SpareEntities db = EntitiesFactory.CreateSpareInstance()) { _billList = ReportViewController.GetSafeQtysList(db); if (!string.IsNullOrEmpty(GlobalVar.Oper.DeptCode)) { _billList = _billList.Where(p => p.仓库 == GlobalVar.Oper.DeptCode).ToList(); } grid.PrimaryGrid.DataSource = _billList; } }
private void GetBillList() { using (SpareEntities db = EntitiesFactory.CreateSpareInstance()) { _billList = ReportViewController.GetCalInaction(db); if (!string.IsNullOrEmpty(GlobalVar.Oper.DeptCode)) { var _SLlist = db.TA_STORE_LOCATION.Where(l => l.WhseCode == GlobalVar.Oper.DeptCode) .Select(l => l.LocCode) .ToList(); _billList = _billList.Where(p => _SLlist.Contains(p.所在库位)).ToList(); } grid.PrimaryGrid.DataSource = _billList; } }
private void GetBillList() { using (SpareEntities db = EntitiesFactory.CreateSpareInstance()) { _billList = ReportViewController.GetStockDetail(db); if (!string.IsNullOrEmpty(GlobalVar.Oper.DeptCode)) { var _SLlist = db.TA_STORE_LOCATION.Where(l => l.WhseCode == GlobalVar.Oper.DeptCode) .Select(l => l.LocCode) .ToList(); _billList = _billList.Where(p => _SLlist.Contains(p.库位)).ToList(); } grid.PrimaryGrid.DataSource = _billList; var totalQty = _billList.Sum(p => p.数量); var totalAmount = _billList.Sum(p => p.金额); grid.PrimaryGrid.Footer.Text = "库存总量:" + totalQty + " 金额:" + totalAmount; } }
public ActionResult Index(DateTime?dateFrom = null, DateTime?dateTo = null, string reportFor = null, int?product_id = 0, int?catagory_id = 0) { ReportViewController reportView = new ReportViewController(); if (reportFor == "sale") { if (product_id == 0 && catagory_id == 0) { reportView.purchases = new List <Purchase>(); reportView.sales = inv.Sales.Where(c => c.date >= dateFrom && c.date <= dateTo).ToList(); } else { reportView.purchases = new List <Purchase>(); reportView.sales = inv.Sales.Where(c => c.product_id == product_id && c.category_id == catagory_id && (c.date >= dateFrom && c.date <= dateTo)).ToList(); } } else if (reportFor == "purchase") { if (product_id == 0 && catagory_id == 0) { reportView.sales = new List <Sale>(); reportView.purchases = inv.Purchases.Where(c => c.date >= dateFrom && c.date <= dateTo).ToList(); } else { reportView.sales = new List <Sale>(); reportView.purchases = inv.Purchases.Where(c => c.product_Id == product_id && c.catagory_id == catagory_id && (c.date >= dateFrom && c.date <= dateTo)).ToList(); } } if (reportView.purchases.Count == 0 && reportView.sales.Count == 0) { ViewBag.Message = "No data Found !"; } reportView.suppliers = inv.Informations.Where(c => c.usertype == "supplier").ToList(); reportView.categories = inv.Categories.ToList(); return(View(reportView)); }