private List <PmrCycleModel> GetListCycles()
        {
            idOperation = ClientForForGenericReports
                          .GetOperationIDForOperationNumber(IDBContext.Current.Operation);

            return(ClientPMRForCycleModel.GetCyclesForPMR(
                       IDBContext.Current.CurrentLanguage, idOperation ?? 0)
                   .OrderByDescending(x => x.PmrCycleId).ToList());
        }
        public virtual ActionResult PMROperationReportCreate(string OperationNumber)
        {
            ViewBag.OperationNumber = OperationNumber;
            this.idOperation        = ClientForForGenericReports.GetOperationIDParentForOperationNumber(OperationNumber);

            if (idOperation != null && idOperation != 0)
            {
                int OperationID;
                OperationID = Convert.ToInt32(this.idOperation);
                PMROperationReportModel ModelOperationReport = new PMROperationReportModel()
                {
                    OperationId = OperationID
                };

                try
                {
                    ModelOperationReport.PMRCycles = ClientPMRForCycleModel.GetCyclesForPMR(Lang, OperationID).OrderByDescending(x => x.PmrCycleId).ToList();

                    ViewBag.ListPMRCycle = new MultiSelectList(ModelOperationReport.PMRCycles, "PmrCycleId", "PmrCycleName");
                    bool ParentOperation = ClientPMRForCycleModel.ValidateOperationParent(OperationID);
                    ModelOperationReport.FinancialDataAggregation = ParentOperation;

                    ModelOperationReport.ReportTypes.Add("Complete", Localization.GetText("Complete"));
                    ModelOperationReport.ReportTypes.Add("Custom", Localization.GetText("Custom"));
                    ModelOperationReport.ReportTypes.Add("Results Matrix", Localization.GetText("Results Matrix"));

                    ViewBag.ListReportsType = new SelectList(ModelOperationReport.ReportTypes, "Key", "Value");

                    return(View(ModelOperationReport));
                }
                catch (Exception e)
                {
                    return(HttpNotFound(e.Message));
                }
            }

            return(HttpNotFound());
        }