Пример #1
0
        private void FillOut(FileInfo file)
        {
            var excel = OpenXMLSpreadsheet.Open(file.FullName);

            FixedList <ProjectItem> activities = GetActivitiesToExport();

            int i = 4;

            foreach (var activity in activities)
            {
                ActivityModel template = ((Activity)activity).Template;

                excel.SetCell($"A{i}", activity.Name);
                excel.SetCell($"B{i}", activity.Notes);
                excel.SetCell($"C{i}", template.LegalBasis);
                excel.SetCell($"D{i}", activity.ForeignLanguageData.Name);
                excel.SetCell($"E{i}", activity.ForeignLanguageData.Notes);
                excel.SetCell($"F{i}", activity.ForeignLanguageData.LegalBasis);
                excel.SetCell($"G{i}", activity.Theme);
                excel.SetCell($"H{i}", template.ActivityType);
                excel.SetCell($"I{i}", template.ExecutionMode);
                excel.SetCell($"J{i}", activity.Level);
                excel.SetCell($"K{i}", activity.Parent.Name);
                excel.SetCell($"L{i}", activity.UID);
                excel.SetCell($"M{i}", activity.Id);

                i++;
            }

            excel.SetCell($"A1", this.Process.Name);

            excel.Save();

            excel.Close();
        }
Пример #2
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;
            }
        }
Пример #3
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;
            }
        }
Пример #4
0
        private void FillOut(FileInfo file)
        {
            var excel = OpenXMLSpreadsheet.Open(file.FullName);

            FixedList <ProjectItem> activities = GetActivitiesToExport();

            int i = 4;

            foreach (var activity in activities)
            {
                ActivityModel template = activity.HasTemplate ?
                                         activity.GetTemplate().Template : ActivityModel.Empty;

                excel.SetCell($"A{i}", activity.Name);
                excel.SetCell($"B{i}", activity.Notes);
                excel.SetCell($"C{i}", template.LegalBasis);
                excel.SetCell($"D{i}", activity.ForeignLanguageData.Name);
                excel.SetCell($"E{i}", activity.ForeignLanguageData.Notes);
                excel.SetCell($"F{i}", activity.ForeignLanguageData.LegalBasis);
                excel.SetCell($"G{i}", activity.Theme);
                excel.SetCell($"H{i}", activity.Tag);
                excel.SetCell($"I{i}", activity.Status.ToString());
                excel.SetCell($"J{i}", GetAssignee(activity));
                excel.SetCell($"K{i}", ToString(activity.Deadline));
                excel.SetCell($"L{i}", ToString(activity.PlannedEndDate));
                excel.SetCell($"M{i}", ToString(activity.ActualEndDate));
                excel.SetCell($"N{i}", template.ActivityType);
                excel.SetCell($"O{i}", template.ExecutionMode);
                excel.SetCell($"P{i}", activity.UID);

                i++;
            }

            excel.SetCell($"A1", this.Project.Name);

            excel.Save();

            excel.Close();
        }
Пример #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;
            }
        }
Пример #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;
            }
        }