public DynamicProjectReportViewModel GetDynamicProjectGroupItemReport(int page, int size, int projectId, int stockTypeId, int categoryId, string stockCode, string stockName, string action, int supplierId, string fd, string td) { var model = new DynamicProjectReportViewModel(); var paramss = new DynamicParameters(); paramss.Add("page", page); paramss.Add("size", size); paramss.Add("projectId", projectId); paramss.Add("stockTypeId", stockTypeId); paramss.Add("categoryId", categoryId); paramss.Add("stockCode", stockCode); paramss.Add("stockName", stockName); paramss.Add("action", action); paramss.Add("supplierId", supplierId); paramss.Add("fd", fd); paramss.Add("td", td); paramss.Add("out", dbType: DbType.Int32, direction: ParameterDirection.Output); using (var sql = GetSqlConnection()) { var data = sql.Query <XDynamicProjectGroupItemReport>("XGetDynamicProjectGroupItemReport", paramss, commandType: CommandType.StoredProcedure); sql.Close(); model.DynamicProjectGroupItemReports = data.ToList(); var total = paramss.Get <int>("out"); model.TotalRecords = total; var totalTemp = Convert.ToDecimal(total) / Convert.ToDecimal(size); model.TotalPages = Convert.ToInt32(Math.Ceiling(totalTemp)); } return(model); }
public ActionResult DynamicProject() { var model = new DynamicProjectReportViewModel(); var projects = _systemService.ProjectList(); model.ProjectIds = projects; model.ProjectNames = projects; model.Suppliers = _systemService.SupplierList(); model.StockTypes = _systemService.TypeStockList(); model.StockCategories = _systemService.CategoryStockList(0); return View(model); }
public ActionResult DynamicProject() { var model = new DynamicProjectReportViewModel(); var projects = _systemService.ProjectList(); model.ProjectIds = projects; model.ProjectNames = projects; model.Suppliers = _systemService.SupplierList(); model.StockTypes = _systemService.TypeStockList(); model.StockCategories = _systemService.CategoryStockList(0); return(View(model)); }
public DynamicProjectReportViewModel GetDynamicProjectReport(int page, int size, int projectId, int stockTypeId, int categoryId, string stockCode, string stockName, string action, int supplierId, string fd, string td) { var model = new DynamicProjectReportViewModel(); var paramss = new DynamicParameters(); paramss.Add("page", page); paramss.Add("size", size); paramss.Add("projectId", projectId); paramss.Add("stockTypeId", stockTypeId); paramss.Add("categoryId", categoryId); paramss.Add("stockCode", stockCode); paramss.Add("stockName", stockName); paramss.Add("action", action); paramss.Add("supplierId", supplierId); paramss.Add("fd", fd); paramss.Add("td", td); paramss.Add("out", dbType: DbType.Int32, direction: ParameterDirection.Output); using (var sql = GetSqlConnection()) { var data = sql.Query<XDynamicProjectReport>("XGetDynamicProjectReport", paramss, commandType: CommandType.StoredProcedure); sql.Close(); model.DynamicProjectReports = data.ToList(); var total = paramss.Get<int>("out"); model.TotalRecords = total; var totalTemp = Convert.ToDecimal(total) / Convert.ToDecimal(size); model.TotalPages = Convert.ToInt32(Math.Ceiling(totalTemp)); } return model; }