Exemplo n.º 1
0
        public ActionResult Index(InsBudgetRequest request)
        {
            var ProjectList = this.ProjectService.GetProjectBasedataList(new ProjectRequest());
            this.ViewBag.ProjectBasedataID = new SelectList(ProjectList, "ID", "PName");

            var result = this.ProjectService.GetInsBudgetList(request);
            //foreach (var rt in result)
            //{
            //    if (rt.InsLaborCost != null)
            //    {
            //        rt.InsBudgetTotal += rt.InsLaborCost.LaborTotal;
            //    }
            //    if (rt.InsMaterialCost != null)
            //    {
            //        rt.InsBudgetTotal += rt.InsMaterialCost.MaterialTotal;
            //    }
            //    if (rt.InsMachineryCost != null)
            //    {
            //        rt.InsBudgetTotal += rt.InsMachineryCost.MachineryTotal;
            //    }
            //    if (rt.InsMeasure != null)
            //    {
            //        rt.InsBudgetTotal += rt.InsMeasure.MeasureTotal;
            //    }
            //    if (rt.InsOverhead != null)
            //    {
            //        rt.InsBudgetTotal += rt.InsOverhead.OverheadTotal;
            //    }
               
            //}
            return View(result);
        }
Exemplo n.º 2
0
 public IEnumerable<InsBudgetInfo> GetInsBudgetList(InsBudgetRequest request = null)
 {
     request = request ?? new InsBudgetRequest();
     using (var dbContext = new ProjectDbContext())
     {
         IQueryable<InsBudgetInfo> InsBudgetInfos = dbContext.InsBudgetInfos.Include("ProjectBasedata");
         if (request.ProjectBasedataID > 0)
             InsBudgetInfos = InsBudgetInfos.Where(d => d.ProjectBasedataID == request.ProjectBasedataID);
         return InsBudgetInfos.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
     }
 }