Ejemplo n.º 1
0
        //static private void ExecutePDFAutofill(this Autofill autofill,
        //                                            string fullPath, bool uploaded) {
        //  var defaults = autofill.StepDataObject.DataItem.GetPDFFormFields();

        //  try {
        //    var pdfFields = PdfFieldsReader.GetFields(fullPath);

        //    JsonObject json = new JsonObject();

        //    foreach (var field in pdfFields) {
        //      if (uploaded) {
        //        json.AddIfValue(field.Key, field.Value);
        //      } else {
        //        json.Add(field.Key, field.Value);
        //      }
        //    }

        //    autofill.AutofillFields = json;
        //    autofill.Save();

        //  } catch (Exception e) {
        //    throw e;
        //  }
        //}


        static private void FillOutMensualActividadesCNH(this Autofill autofill,
                                                         string fullPath)
        {
            try {
                var excel = OpenXMLSpreadsheet.Open(fullPath);

                var tasks = ReportingRepository.GetCNHActividad();

                int i = 12;

                foreach (var task in tasks)
                {
                    excel.SetCell($"T{i}", "Vista Oil & Gas Holding II, S.A. de C.V.");
                    excel.SetCell($"U{i}", "Vernet-1001EXP");
                    excel.SetCell($"V{i}", "CNH-R02-L03-CS-01/2017");
                    //excel.SetCell($"M{i}", random.Next(0, 12));
                    //excel.SetCell($"N{i}", random.Next(5, 10));
                    //excel.SetCell($"O{i}", random.Next(1, 10));
                    //excel.SetCell($"P{i}", random.Next(4, 9));
                    //excel.SetCell($"Q{i}", random.Next(0, 50));
                    //excel.SetCell($"R{i}", random.Next(0, 30));
                    //excel.SetCell($"S{i}", random.Next(10, 50));
                    //excel.SetCell($"T{i}", random.Next(20, 40));
                    //excel.SetCell($"U{i}", random.Next(5, 40));
                    //excel.SetCell($"V{i}", random.Next(0, 50));
                }

                excel.Save();

                excel.Close();
            } catch (Exception e) {
                throw e;
            }
        }
        public void SetUpFixture()
        {
            _connection = new GetOpenConnectionFromConnectionString(DatabaseConfigurationProvider.Instance.TargetConnectionString);

            _logger = new Mock <ILogService>();

            _repoUnderTest = new ReportingRepository(_connection, _logger.Object);
        }
Ejemplo n.º 3
0
        // GET: Reporting
        public ActionResult Index()
        {
            var factory = new ReportingFactory();
            var repo    = new ReportingRepository();

            // Map the Exception Reason names from the cplx EF class to the ExceptionReasonNamesModel
            var data = repo
                       .GetReportNames()
                       .ToList()
                       .Select(x => factory.Create(x));

            var model = new ReportingModel();

            // Put the list of Exception Reasons in the List for the drop down.
            model.ReportListNames.AddRange(data);

            try {
                ReportViewer reportViewer = new ReportViewer();
                ServerReport serverReport = reportViewer.ServerReport;

                reportViewer.ProcessingMode = ProcessingMode.Remote;


                // Set the report server URL and report path
                //reportViewer.ServerReport.ReportServerUrl = new Uri ("http://localhost/ReportServer/");
                serverReport.ReportServerUrl = new Uri("http://mlk-ssr-d-sq01/Reports/");

                //reportViewer.ServerReport.ReportPath = "/AdventureWorks 2012/Sales_by_Region";
                serverReport.ReportPath = "Call+Compliance%2fODS+Status";

                serverReport.Refresh();

                //reportViewer.ServerReport.ReportPath =
                // "http://mlk-ssr-d-sq01/Reports/Pages/Report.aspx?ItemPath=%2fCall+Compliance%2fODS+Status";
                //reportViewer.ServerReport.ReportServerUrl = new Uri("http://reporting-dev.ultimatemedical.edu/");
                ViewBag.ReportViewer = reportViewer;
            } catch (Exception ex) {
            }
            return(View(model));
        }
Ejemplo n.º 4
0
        static private void FillOutBitacoraOperaciones(this Autofill autofill,
                                                       string fullPath)
        {
            try {
                var excel = OpenXMLSpreadsheet.Open(fullPath);

                var tasks = ReportingRepository.GetCNIHOperacionDiaria();

                int i = 5;

                foreach (var task in tasks)
                {
                    excel.SetCell($"A{i}", "Vista Oil & Gas Holding II, S.A. de C.V.");
                    excel.SetCell($"B{i}", "Vernet-1001EXP");
                    excel.SetCell($"C{i}", "590480190000200");
                    excel.SetCell($"D{i}", "CNH-R02-L03-CS-01/2017");
                    excel.SetCell($"E{i}", task.Get <string>("diasEnOperacion", String.Empty).ToUpper());
                    excel.SetCell($"F{i}", task.Get <string>("proximoMovimiento", String.Empty).ToUpper());
                    excel.SetCell($"G{i}", task.Get <string>("tipoTerminacion", String.Empty).ToUpper());
                    excel.SetCell($"H{i}", task.Get <string>("registroHidrocarburos", String.Empty).ToUpper());
                    excel.SetCell($"I{i}", task.Get <string>("fechaReporte", String.Empty).ToUpper());
                    excel.SetCell($"J{i}", task.Get <string>("tiempoDias", String.Empty).ToUpper());
                    excel.SetCell($"K{i}", task.Get <string>("metrosDesarrollados", String.Empty).ToUpper());
                    excel.SetCell($"L{i}", task.Get <string>("metrosVerticales", String.Empty).ToUpper());
                    excel.SetCell($"M{i}", task.Get <string>("pesoAplicadoBarrena", String.Empty).ToUpper());
                    excel.SetCell($"N{i}", task.Get <string>("velocidadMR", String.Empty).ToUpper());
                    excel.SetCell($"O{i}", task.Get <string>("presionBomba", String.Empty).ToUpper());
                    excel.SetCell($"P{i}", task.Get <string>("torque", String.Empty).ToUpper());
                    excel.SetCell($"Q{i}", task.Get <string>("pesoSarta", String.Empty).ToUpper());

                    i++;
                }

                excel.Save();

                excel.Close();
            } catch (Exception e) {
                throw e;
            }
        }
Ejemplo n.º 5
0
        static private void FillOutMuestraFluidos(this Autofill autofill,
                                                  string fullPath)
        {
            try {
                var excel = OpenXMLSpreadsheet.Open(fullPath);

                var tasks = ReportingRepository.GetCNIHFluido();

                int i = 4;

                foreach (var task in tasks)
                {
                    excel.SetCell($"A{i}", "Vista Oil & Gas Holding II, S.A. de C.V.");
                    excel.SetCell($"B{i}", "Vernet-1001EXP");
                    excel.SetCell($"C{i}", "590480190000200");
                    excel.SetCell($"D{i}", "CNH-R02-L03-CS-01/2017");
                    excel.SetCell($"E{i}", task.Get <string>("archivoLaboratorio", String.Empty).ToUpper());
                    excel.SetCell($"F{i}", task.Get <string>("tipoMuestras", String.Empty).ToUpper());
                    excel.SetCell($"G{i}", task.Get <string>("fechaMuestreo", String.Empty).ToUpper());
                    excel.SetCell($"H{i}", task.Get <string>("fechaEntrega", String.Empty).ToUpper());
                    excel.SetCell($"I{i}", task.Get <string>("caja", String.Empty).ToUpper());
                    excel.SetCell($"J{i}", task.Get <string>("intervaloProbado", String.Empty).ToUpper());
                    excel.SetCell($"K{i}", task.Get <string>("cantidadMuestra", String.Empty).ToUpper());
                    excel.SetCell($"P{i}", task.Get <string>("condicionesTomaMuestra", String.Empty).ToUpper());
                    excel.SetCell($"R{i}", task.Get <string>("observaciones", String.Empty).ToUpper());

                    i++;
                }

                excel.Save();

                excel.Close();
            } catch (Exception e) {
                throw e;
            }
        }
Ejemplo n.º 6
0
        static private void FillOutSasisopa(this Autofill autofill,
                                            string fullPath)
        {
            try {
                var excel = OpenXMLSpreadsheet.Open(fullPath);

                var tasks = ReportingRepository.GetSasisopaTasksList(autofill.StepDataObject);

                int i = 4;

                foreach (var task in tasks)
                {
                    excel.SetCell($"A{i}", task.Get <string>("anexo", String.Empty));
                    excel.SetCell($"B{i}", task.Get <string>("elemento", String.Empty));
                    excel.SetCell($"C{i}", task.Get <string>("actividad", String.Empty));
                    excel.SetCell($"D{i}", task.Get <string>("descripcion", String.Empty));
                    excel.SetCell($"E{i}", task.Get <string>("fechasInicio", String.Empty));
                    excel.SetCell($"F{i}", task.Get <string>("fechasTermino", String.Empty));
                    excel.SetCell($"G{i}", task.Get <string>("periodicidad", String.Empty));
                    excel.SetCell($"H{i}", task.Get <string>("responsable", String.Empty));
                    excel.SetCell($"I{i}", task.Get <string>("evidencias", String.Empty));
                    excel.SetCell($"J{i}", task.Get <string>("documentosAnexos", String.Empty));
                    excel.SetCell($"K{i}", task.Get <string>("avance", String.Empty));
                    excel.SetCell($"L{i}", task.Get <string>("observaciones", String.Empty));
                    excel.SetCell($"M{i}", task.Get <string>("siguientesAcciones", String.Empty));

                    i++;
                }

                excel.Save();

                excel.Close();
            } catch (Exception e) {
                throw e;
            }
        }
Ejemplo n.º 7
0
 public ReportingViewModel(ReportingRepository employeeRepository)
 {
     this.employeeRepository = employeeRepository;
 }
Ejemplo n.º 8
0
 public SampleModel(ReportingRepository repository)
 {
     _repository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Ejemplo n.º 9
0
 public ReportingController(LeaveManagementDbContext leaveManagementDbContext)
 {
     _dbContext = leaveManagementDbContext;
     _repRepo   = new ReportingRepository(_dbContext);
 }
Ejemplo n.º 10
0
 public CourseStudentsAnalysisHandler(ReportingContext context)
 {
     _repository = new ReportingRepository(context);
 }