Exemple #1
0
        public virtual ActionResult Create(string OperationNumber)
        {
            var OperationId = ClientGenericRepositoty.GetOperationIDForOperationNumber(OperationNumber);
            var ListSupervisionPlanOperation = ClienSupervisionPlan.GetYearsForSupervicionPlan(OperationId);
            SupervisionPlanOperationReport ModelSupervisionPlan;

            if (ListSupervisionPlanOperation.Any())
            {
                ModelSupervisionPlan = ClientGenericRepositoty.GetSupervisionPlanVersionByYear(OperationId, ListSupervisionPlanOperation[0].Year);
            }
            else
            {
                ModelSupervisionPlan = new SupervisionPlanOperationReport();
            }

            ViewBag.ListSupervisionPlanOperation = new SelectList(ListSupervisionPlanOperation, "Year", "Year");

            return(View(ModelSupervisionPlan));
        }
Exemple #2
0
        public virtual ActionResult DownloadSupervisionReport(SupervisionPlanOperationReport ModelSupervisionPlan)
        {
            string LinkReportSupervicionPlan = string.Empty;

            LinkReportSupervicionPlan += ReportBuilder.GetReportPreffix("ParamForSupervisionPlan");

            if (Lang != null)
            {
                LinkReportSupervicionPlan += "&LANG=" + Lang;
            }
            else
            {
                LinkReportSupervicionPlan += "&LANG=EN";
            }

            if (ModelSupervisionPlan.OperationID != 0)
            {
                LinkReportSupervicionPlan += "&OPERATION_ID=" + ModelSupervisionPlan.OperationID;
            }

            if (ModelSupervisionPlan.SupervisionVersion.Count > 0)
            {
                foreach (var item in ModelSupervisionPlan.SupervisionVersion)
                {
                    if (item.Value)
                    {
                        LinkReportSupervicionPlan += "&SUPERVISION_PLAN_VERSION_ID=" + item.Key;
                    }
                }
            }
            else
            {
                LinkReportSupervicionPlan = "You Haven't supervision plan version";
            }

            LinkReportSupervicionPlan += "&rs:Format=" + ModelSupervisionPlan.ExportType;

            return(Content(LinkReportSupervicionPlan));
        }