public ActionResult BreakingProjectsByMonth(ReportParametersFromToJson parameters)
 {
     if (ModelState.IsValid)
     {
         Session["Reports"] = new ReportAssembler().AssembleBreakingProjectsByMonth(parameters);
         return(RedirectToAction("ReportView"));
     }
     else
     {
         return(View());
     }
 }
 public ActionResult TotalWorkHoursOnProjects(ReportParametersFromToJson parameters)
 {
     if (ModelState.IsValid)
     {
         Session["Reports"] = new ReportAssembler().AssembleTotalWorkHoursOnProjects(parameters);
         return(RedirectToAction("ReportView"));
     }
     else
     {
         return(View());
     }
 }
Exemplo n.º 3
0
		public LoadTranscriptionForEditResponse LoadTranscriptionForEdit(LoadTranscriptionForEditRequest request)
		{
			var step = this.PersistenceContext.Load<ReportingProcedureStep>(request.ReportingStepRef, EntityLoadFlags.CheckVersion);
			var reportAssembler = new ReportAssembler();
			var orderAssembler = new OrderAssembler();

			var orderDetailOptions = new OrderAssembler.CreateOrderDetailOptions {IncludeExtendedProperties = true};
			return new LoadTranscriptionForEditResponse(
				reportAssembler.CreateReportDetail(step.ReportPart.Report, false, this.PersistenceContext),
				step.ReportPart.Index,
				orderAssembler.CreateOrderDetail(step.Procedure.Order, orderDetailOptions, this.PersistenceContext));
		}
        public LoadTranscriptionForEditResponse LoadTranscriptionForEdit(LoadTranscriptionForEditRequest request)
        {
            var step            = this.PersistenceContext.Load <ReportingProcedureStep>(request.ReportingStepRef, EntityLoadFlags.CheckVersion);
            var reportAssembler = new ReportAssembler();
            var orderAssembler  = new OrderAssembler();

            var orderDetailOptions = new OrderAssembler.CreateOrderDetailOptions {
                IncludeExtendedProperties = true
            };

            return(new LoadTranscriptionForEditResponse(
                       reportAssembler.CreateReportDetail(step.ReportPart.Report, false, this.PersistenceContext),
                       step.ReportPart.Index,
                       orderAssembler.CreateOrderDetail(step.Procedure.Order, orderDetailOptions, this.PersistenceContext)));
        }
 public ActionResult BreakingProjectByMonth(ReportParametrsFromToProjectIdJson parameters)
 {
     if (ModelState.IsValid)
     {
         Session["Reports"] = new ReportAssembler().AssembleBreakingProjectByMonth(parameters);
         return(RedirectToAction("ReportView"));
     }
     else
     {
         UnitOfWork     uow            = new UnitOfWork();
         UserManager    UserManager    = new UserManager(uow);
         ProjectManager projectManager = new ProjectManager(uow);
         var            currentUser    = new UserHelper().GetCurrent();
         var            t = projectManager.GetByUser(currentUser);
         ViewBag.ProjectIDs = projectManager.GetByUser(currentUser);
         return(View());
     }
 }
        public ActionResult PersonelsAndProjects(ReportParametersJson parameters)
        {
            if (ModelState.IsValid)
            {
                Session["Reports"] = new ReportAssembler().AssemblePersonnelsAndProjects(parameters);
                return(RedirectToAction("ReportView"));
            }
            else
            {
                UnitOfWork     uow            = new UnitOfWork();
                UserManager    UserManager    = new UserManager(uow);
                ProjectManager projectManager = new ProjectManager(uow);
                var            currentUser    = new UserHelper().GetCurrent();
                //ViewBag.UserID = new SelectList(UserManager.GetMyEmployees(currentUser), "ID", "UserTitle");
                //ViewBag.ProjectID = new SelectList(projectManager.GetByUser(currentUser), "ID", "Title");

                var users = new List <SelectListItem>();

                foreach (var user in UserManager.GetMyEmployees(currentUser).ToList())
                {
                    var pushuser = new SelectListItem();
                    pushuser.Text  = user.UserTitle;
                    pushuser.Value = user.ID.ToString();
                    users.Add(pushuser);
                }
                ViewBag.Users = users;

                var projects = new List <SelectListItem>();
                foreach (var user in UserManager.GetMyEmployees(currentUser).ToList())
                {
                    foreach (var project in projectManager.GetByUser(user).ToList())
                    {
                        var pushproject = new SelectListItem();
                        pushproject.Text  = project.Title;
                        pushproject.Value = project.ID.ToString();
                        projects.Add(pushproject);
                    }
                }
                ViewBag.Projects = projects.GroupBy(x => x.Text).Select(y => y.FirstOrDefault()).ToList();
                return(View());
            }
        }