Пример #1
1
        private void CargaAlterno(Planificador Pactual,Proceso Procesado, int numProc, int maximo, int Iesimo)
        {
            // generar grafica alterna obligada
            this.GantAlterno.Checked = true;
            Pactual.GantAlterno(Procesado, numProc, maximo, Iesimo);

            // desplegar el gant en la caja de texto
            for (int i = 0; i < numProc; i++)
            {

                for (int j = 0; j < maximo; j++)
                {
                    // mostrar el gant en la caja de texto

                    this.txtAlt.Text += String.Format("{0}",Pactual.gant[i,j]);
                    txtAlt.Refresh();
                }
                txtAlt.Text += @"
                    ";

            }
        }
Пример #2
1
        private void button2_Click(object sender, EventArgs e)
        {
            string ruta = this.ruta;
            StreamReader lectr = new StreamReader(ruta);
            int numProc = Convert.ToInt16(lectr.ReadLine());
            lectr.Close();

            StreamWriter Escritor = new StreamWriter(@"C: \Users\frodo\Desktop\Planificacion\GantAlterno.txt");

            // cola de usados
            Queue usados = new Queue(numProc);

            // crear vector de procesos
            Proceso[] vectProc = new Proceso[numProc];
            for (int i = 0; i < vectProc.Length; i++)
                vectProc[i] = new Proceso();

            // crear cola de procesos
            Queue colaProc = new Queue(numProc);
            Queue colaCop = new Queue(numProc);

            // crear un planificador
            Planificador plnfcdr1 = new Planificador();

            // leer archivos y meterlos en el vector
            Planificador.leerArchivo(vectProc,ruta);
            int llegada = vectProc[0].GSTiempoLLegada;

            int maximo = 0;

            foreach (Proceso P in vectProc)
                            maximo += P.GSduracion;

            plnfcdr1.gant = new string[numProc, maximo*2];
            plnfcdr1.InicarGant(numProc, maximo*2);

            // decidir segund el algoritmo de planificacion
            switch (this.comboBox1.Text)
            {

                case "SJF":
                    int espera = 1;
                    int Tinicio = 1;
                    int Tfinal = 1;
                    int yValue = 1;
                    int cont = 0;

                    while ( cont < numProc  )
                     {
                        Proceso Procesado = plnfcdr1.PlanificarSJF(colaProc, vectProc, Tinicio,Tfinal, espera);
                        plnfcdr1.LLenarGant(Procesado, cont, maximo);

                            if ( !this.GantAlterno.Checked )
                                Graficar(Procesado, yValue, espera);

                        colaCop.Enqueue(Procesado);
                        if (Procesado != null)
                        {

                            Tinicio += Procesado.GSTiempoLLegada;
                            Tfinal += Procesado.GSduracion;
                            espera += Procesado.GSduracion;

                            this.display(Procesado);

                            yValue++;
                            cont++;

                        }
                        Tfinal++;
                      }
                break;

                case "FcFs":

                    yValue = 1;
                    espera = 1;
                    foreach(Proceso p in vectProc)
                    {
                        colaProc.Enqueue(p);
                        Proceso Procesado = plnfcdr1.PlanificarFcFs(colaProc, espera);
                        plnfcdr1.LLenarGant(Procesado, yValue -1, maximo);

                        colaCop.Enqueue(Procesado);
                        Graficar(Procesado, yValue, espera);
                        espera += Procesado.GSduracion  ;
                        yValue++;
                        this.display(Procesado);
                    }

                    break;

                case "SJFX":

                    ArrayList l = new ArrayList();
                    foreach (Proceso p in vectProc)
                        l.Add(p);
                    int i = 0;
                   Queue Procesados =  plnfcdr1.PlanificarSJFX(l);
                    foreach (Proceso p in Procesados)
                    {
                        this.display(p);
                        try
                        {
                            this.GraficarProceso(p, i + 1 , p.Tinicio);
                            i++;
                        }
                        catch(Exception Ex)
                        {
                            i++;
                        }
                    }

                    colaCop = Procesados;

                    break;

                case "SRTF":
                    // meter procesos a la lista
                    ArrayList ListaProc = new ArrayList();
                    foreach (Proceso P in vectProc )
                        ListaProc.Add(P);

                    i = 0;
                    Queue ProcesadosSRTF = plnfcdr1.PlanificarSRFT(ListaProc);

                    // dar salida grafica
                    foreach( Proceso P in ProcesadosSRTF )
                    {
                        this.display(P);
                        try
                        {
                            this.GraficarProceso(P, i + 1, P.Tinicio);
                        }
                        finally
                        {
                            i++;
                        }
                    }
                    colaCop = ProcesadosSRTF;
                    break;

                case "Round Robin":
                    // meter procesos a la lista
                    ArrayList ListaProcRR = new ArrayList();
                    foreach (Proceso P in vectProc)
                        ListaProcRR.Add(P);

                    i = 0;

                    // planificar RR
                    Queue ProcesadosRR = plnfcdr1.PlanificarRR(ListaProcRR);

                    // graficar procesos
                    foreach (Proceso P in ProcesadosRR)
                    {
                        this.display(P);
                        try
                        {
                            this.GraficarProceso(P, i + 1, P.Tinicio);
                        }
                        finally
                        {
                            i++;
                        }
                    }
                    colaCop = ProcesadosRR;
                    break;

                case "Priority":
                    ArrayList lentrada = new ArrayList();
                    foreach (Proceso p in vectProc)
                        lentrada.Add(p);

                    colaCop = plnfcdr1.PlanificarPrioridad(lentrada);
                    i = 1;
                    foreach (Proceso p in colaCop)
                    {
                        this.display(p);
                        this.GraficarProceso(p, i, p.Tinicio);
                        i++;

                    }
                    break;

                case "PriorityX":
                    ArrayList lentradaP = new ArrayList();
                    foreach (Proceso p in vectProc)
                        lentradaP.Add(p);

                    colaCop = plnfcdr1.PlanificarPrioridadX(lentradaP);
                    i = 1;
                    foreach (Proceso p in colaCop)
                    {
                        this.display(p);
                        this.GraficarProceso(p, i, p.Tinicio);
                        i++;

                    }
                    break;

                case "HRRN":

                    ArrayList ListaEntrada  = new ArrayList();
                    ArrayList ListaEstatica = new ArrayList();
                    foreach (Proceso p in vectProc)
                    {
                        ListaEntrada.Add(p);
                        ListaEstatica.Add(p);
                    }

                    colaCop = plnfcdr1.PlanificarHRRN(ListaEntrada);

                    foreach( Proceso p in colaCop)
                    {
                        this.display(p);
                        this.GraficarProceso(p, 1+ plnfcdr1.ConvertIndx(p, ListaEstatica), p.Tinicio);
                    }

                    break;
            }

            // poner el tiempo promedio en la etiqeta

            plnfcdr1.ImprimirGantTxt(Escritor, numProc, maximo*2, vectProc);
            Escritor.Close();
            if (this.GantAlterno.Checked)
                this.DsplGantAlt();

            this.lblPromedio.Text = string.Format("{0:C2}" , Convert.ToString( (float)plnfcdr1.GetStdstcs(colaCop, numProc) ));
        }
        public bool GuardarXML(Proceso proceso , out bool esnuevo)
        {
            bool exito = false;

            esnuevo = false;

            string path = SingletonSetting.Instance.directorioProcesos + @"\" + proceso.nombreArchivoBaseXML;

            if (Archivos.Contains(proceso.nombreArchivoBaseXML))
            {
                if (File.Exists(path))
                {
                    exito = GuardaArchivo(proceso, path);
                    return exito;
                }
            }
            else
            {
                /*
                 *archivo nuevo
                 */
                esnuevo = true;

                if (!File.Exists(path))
                {
                    exito = GuardaArchivo(proceso, path);

                    return exito;
                }
            }

            return false;
        }
        public void AgregarProceso(Proceso nuevo)
        {
            if (Cola.Count == 0)
            {
                ContadorCola = 1;
            }

            Cola.Enqueue(nuevo);
            ContadorCola++;
        }
Пример #5
0
 public static void Main(string[] args)
 {
     Proceso proceso = new Proceso();
     Console.WriteLine("Practica no.4 Excepciones! CSV PARSER  ");
     Console.ReadKey(true);
     proceso.leer();
     proceso.ARegistro();
     proceso.IRegistros();
     proceso.ITodo();
 }
    private void Informar(Panel panel_mensaje, Label label_mensaje, String mensaje, Proceso proceso)
    {
        //panel_fondo.Style.Add("display", "block");
        //panel_mensaje.Style.Add("display", "block");

        //label_mensaje.Font.Bold = true;

        //switch (proceso)
        //{
        //    case Proceso.Correcto:
        //        label_mensaje.ForeColor = System.Drawing.Color.Green;
        //        imagen_mensaje.ImageUrl = "~/imagenes/plantilla/ok_popup.png";
        //        break;
        //    case Proceso.Error:
        //        label_mensaje.ForeColor = System.Drawing.Color.Red;
        //        imagen_mensaje.ImageUrl = "~/imagenes/plantilla/error_popup.png";
        //        break;
        //    case Proceso.Advertencia:
        //        label_mensaje.ForeColor = System.Drawing.Color.Orange;
        //        imagen_mensaje.ImageUrl = "~/imagenes/plantilla/advertencia_popup.png";
        //        break;
        //}

        panel_mensaje.Visible = true;
        label_mensaje.Text = mensaje;
    }
    private void Informar(Panel panel_fondo, System.Web.UI.WebControls.Image imagen_mensaje, Panel panel_mensaje, Label label_mensaje, String mensaje, Proceso proceso)
    {
        panel_fondo.Style.Add("display", "block");
        panel_mensaje.Style.Add("display", "block");

        label_mensaje.Font.Bold = true;

        switch (proceso)
        {
        case Proceso.Correcto:
            label_mensaje.ForeColor = System.Drawing.Color.Green;
            imagen_mensaje.ImageUrl = "~/imagenes/plantilla/ok_popup.png";
            break;

        case Proceso.Error:
            label_mensaje.ForeColor = System.Drawing.Color.Red;
            imagen_mensaje.ImageUrl = "~/imagenes/plantilla/error_popup.png";
            break;

        case Proceso.Advertencia:
            label_mensaje.ForeColor = System.Drawing.Color.Orange;
            imagen_mensaje.ImageUrl = "~/imagenes/plantilla/advertencia_popup.png";
            break;
        }

        panel_fondo.Visible   = true;
        panel_mensaje.Visible = true;


        label_mensaje.Text = mensaje;
    }
        private static string GenerarTablaResumen(string pagina, NumberFormatInfo FormatoMoneda, Proceso proceso)
        {
            int total        = 0;
            int totalFactura = 0;

            foreach (var participante in proceso.Solicitud.Participantes)
            {
                total        += participante.Documentos.FindAll(documento => documento.TipoDocumento.Equals("Boleta") && documento.Estado == 1).Sum(doc => doc.Monto);
                totalFactura += participante.Documentos.FindAll(documento => documento.TipoDocumento.Equals("Factura") && documento.Estado == 1).Sum(doc => doc.Monto);
            }


            pagina += "<div style='padding-top:15px; padding-bottom:-15px;'><table><thead><tr class='table100-head'>" +
                      "<th>Ítem</th>" +
                      "<th>Monto</th>" +
                      "</tr></thead><tbody>";

            pagina += "<tr>";
            pagina += "<td><b>Total</b></td>";
            pagina += "<td>" + total.ToString("C0", FormatoMoneda) + "</td>";
            pagina += "</tr>";

            pagina += "<tr>";
            pagina += "<td><b>Facturas</b></td>";
            pagina += "<td>" + totalFactura.ToString("C0", FormatoMoneda) + "</td>";
            pagina += "</tr>";

            pagina += "<tr>";
            pagina += "<td><b>Total declaración de gastos</b></td>";
            pagina += "<td>" + proceso.DeclaracionGastos.TotalRendido.ToString("C0", FormatoMoneda) + "</td>";
            pagina += "</tr>";

            pagina += "</tbody></table></div>";

            return(pagina);
        }
Пример #9
0
        private void Graficar( Proceso ProcesoListo, int Yvalue, int acumulado)
        {
            // crear series
            Series serie = gant.Series.Add(ProcesoListo.GSnombre);
            serie.ChartType = SeriesChartType.Point;

            for (int i = acumulado+1; i <= ProcesoListo.GSduracion + acumulado; i++)
                serie.Points.AddXY(i, Yvalue);
        }
Пример #10
0
        public async Task <IActionResult> DeleteOption(int optionId, int selectId)
        {
            bool notFound = false;

            switch (selectId)
            {
            case 1:
                Actividad actividad = new Actividad
                {
                    Id = optionId
                };
                _context.Actividades.Remove(actividad);
                break;

            case 2:
                Area Area = new Area
                {
                    Id = optionId
                };
                _context.Areas.Remove(Area);
                break;

            case 3:
                Casualidad Casualidad = new Casualidad
                {
                    Id = optionId
                };
                _context.Casualidades.Remove(Casualidad);
                break;

            case 4:
                CausaBasica CausaBasica = new CausaBasica
                {
                    Id = optionId
                };
                _context.CausaBasicas.Remove(CausaBasica);
                break;

            case 5:
                CausaInmediata CausaInmediata = new CausaInmediata
                {
                    Id = optionId
                };
                _context.CausaInmediatas.Remove(CausaInmediata);
                break;

            case 6:
                Clasificacion Clasificacion = new Clasificacion
                {
                    Id = optionId
                };
                _context.Clasificaciones.Remove(Clasificacion);
                break;

            case 7:
                Comportamiento Comportamiento = new Comportamiento
                {
                    Id = optionId
                };
                _context.Comportamientos.Remove(Comportamiento);
                break;

            case 8:
                Efecto Efecto = new Efecto
                {
                    Id = optionId
                };
                _context.Efectos.Remove(Efecto);
                break;

            case 9:
                FactorRiesgo FactorRiesgo = new FactorRiesgo
                {
                    Id = optionId
                };
                _context.FactorRiesgos.Remove(FactorRiesgo);
                break;

            case 10:
                Genero Genero = new Genero
                {
                    Id = optionId
                };
                _context.Generos.Remove(Genero);
                break;

            case 11:
                IndicadorRiesgo IndicadorRiesgo = new IndicadorRiesgo
                {
                    Id = optionId
                };
                _context.IndicadorRiesgos.Remove(IndicadorRiesgo);
                break;

            case 12:
                Jornada Jornada = new Jornada
                {
                    Id = optionId
                };
                _context.Jornadas.Remove(Jornada);
                break;

            case 13:
                Observado Observado = new Observado
                {
                    Id = optionId
                };
                _context.Observados.Remove(Observado);
                break;

            case 14:
                ParteCuerpo ParteCuerpo = new ParteCuerpo
                {
                    Id = optionId
                };
                _context.ParteCuerpos.Remove(ParteCuerpo);
                break;

            case 15:
                Proceso Proceso = new Proceso
                {
                    Id = optionId
                };
                _context.Procesos.Remove(Proceso);
                break;

            case 16:
                Riesgo Riesgo = new Riesgo
                {
                    Id = optionId
                };
                _context.Riesgos.Remove(Riesgo);
                break;

            case 17:
                TipoComportamiento TipoComportamiento = new TipoComportamiento
                {
                    Id = optionId
                };
                _context.TipoComportamientos.Remove(TipoComportamiento);
                break;

            case 18:
                TipoObservado TipoObservado = new TipoObservado
                {
                    Id = optionId
                };
                _context.TipoObservados.Remove(TipoObservado);
                break;

            case 19:
                Turno Turno = new Turno
                {
                    Id = optionId
                };
                _context.Turnos.Remove(Turno);
                break;

            case 20:
                Categoria Categoria = new Categoria
                {
                    Id = optionId
                };
                _context.Categorias.Remove(Categoria);
                break;

            case 21:
                Subcategoria Subcategoria = new Subcategoria
                {
                    Id = optionId
                };
                _context.Subcategorias.Remove(Subcategoria);
                break;


            default:
                notFound = true;
                break;
            }
            if (notFound)
            {
                return(StatusCode(400));
            }
            else
            {
                await _context.SaveChangesAsync();

                return(StatusCode(202));
            }
        }
Пример #11
0
 public int Create([FromBody] Proceso proceso)
 {
     return(objProceso.AddProceso(proceso));
 }
Пример #12
0
        private bool GuardaArchivo(Proceso proceso,string path)
        {
            bool exito = false;

            using (FileStream fs = File.Create(path))
            {
                using (StreamWriter sw = new StreamWriter(fs))
                {

                    if (proceso.id == 0)
                    {
                        proceso.id = Archivos.Count() + 1;
                    }

                    sw.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
                    sw.WriteLine("<root>");
                    sw.WriteLine("  <proceso id=\"" + proceso.id + "\" nombre=\"" + proceso.nombre + "\">");
                    EscribirXML_validar(sw, proceso);
                    EscribirXML_archivoBackup(sw, proceso);
                    EscribirXML_ftp(sw, proceso);
                    EscribirXML_archivoResplado(sw, proceso);
                    EscribirXML_correoFallo(sw, proceso);
                    EscribirXML_correoExito(sw, proceso);
                    EscribirXML_correoLog(sw, proceso);
                    sw.WriteLine("  </proceso>");
                    sw.WriteLine("</root>");

                    exito = true;
                }
            }

            return exito;
        }
Пример #13
0
        public ActionResult Edit(int id)
        {
            EDReporte reporte       = generarEDReporte(id);
            var       usuarioActual = ObtenerUsuarioEnSesion(System.Web.HttpContext.Current);

            if (usuarioActual == null)
            {
                ViewBag.mensaje1 = "Debe Registrarse para Ingresar a este Modulo.";
                return(RedirectToAction("Login", "Home"));
            }
            //List<Proceso> procesos = procesoServicios.ObtenerProcesosPrincipales(usuarioActual.IdEmpresa);


            //List<Proceso> subProcesos = procesoServicios.ObtenerSubProcesos(reportes.FK_Proceso);
            //ViewBag.Procesos = new SelectList(procesos, "Pk_Id_Proceso", "Descripcion_Proceso", reportes.Procesos.Fk_Id_Proceso);

            var resultTipoReporte = ServiceClient.ObtenerArrayJsonRestFul <EDTipoReporte>(UrlServicioParticipacion, CapacidadObtenerTipoReporte, RestSharp.Method.GET);



            //Reporte reportes = db.Tbl_Reportes.Find(id);


            //Reporte reportes = db.Tbl_Reportes.Find(id);


            if (reporte.FK_Proceso != null)
            {
                var            fkProceso = (reporte.Procesos == null) ? 0 : reporte.FK_Proceso;
                List <Proceso> procesos  = procesoServicios.ObtenerProcesosPrincipales(usuarioActual.IdEmpresa);
                Proceso        proceso   = procesoServicios.ObtenerProceso((int)fkProceso);
                ViewBag.Procesos = new SelectList(procesos, "Pk_Id_Proceso", "Descripcion_Proceso", reporte.FK_Proceso);
            }
            else
            {
                List <Proceso> procesos = procesoServicios.ObtenerProcesosPrincipales(usuarioActual.IdEmpresa);
                ViewBag.Procesos = new SelectList(procesos, "Pk_Id_Proceso", "Descripcion_Proceso");
            }

            //if(reporte.FK_Proceso!=null)
            //{
            //    var fkProceso = (reporte.FK_Proceso == null) ? 0:reporte.FK_Proceso;
            //List<Proceso> procesos = procesoServicios.ObtenerProcesosPrincipales(usuarioActual.IdEmpresa);
            //Proceso proceso = procesoServicios.ObtenerProceso((int)fkProceso);
            //List<Proceso> subProcesos = procesoServicios.ObtenerSubProcesos(proceso.Procesos.Pk_Id_Proceso);
            //ViewBag.Procesos = new SelectList(procesos, "Pk_Id_Proceso", "Descripcion_Proceso", proceso.Fk_Id_Proceso);
            //ViewBag.FK_Proceso = new SelectList(subProcesos, "Pk_Id_Proceso", "Descripcion_Proceso", reporte.FK_Proceso);
            //}
            //else
            //{
            //    //ServiceClient.EliminarParametros();
            //    //ServiceClient.AdicionarParametro("NIT", usuarioActual.NitEmpresa);
            //    //var resultProceso = ServiceClient.ObtenerArrayJsonRestFul<EDProceso>(urlServicioEmpresas, CapacidadObtenerprocesosEmpresa, RestSharp.Method.GET);

            //    //ViewBag.Procesos = resultProceso.Select(p => new SelectListItem()
            //    //{
            //    //    Value = p.Id_Proceso.ToString(),
            //    //    Text = p.Descripcion
            //    //}).ToList();


            //    List<Proceso> procesos = procesoServicios.ObtenerProcesosPrincipales(usuarioActual.IdEmpresa);
            //    ViewBag.Procesos = new SelectList(procesos, "Pk_Id_Proceso", "Descripcion_Proceso");


            //}

            ViewBag.idReporte = reporte.IdReportes;
            ViewBag.FKSede    = new SelectList(sedeServicio.SedesPorEmpresa(usuarioActual.IdEmpresa), "Pk_Id_Sede", "Nombre_Sede", reporte.FKSede);

            if (reporte.medioAcceso)
            {
                ViewBag.MedioAcceso = '1';
            }
            else
            {
                ViewBag.MedioAcceso = '0';
            }


            ViewBag.FKTipoReporte   = new SelectList(resultTipoReporte.ToList(), "IdTipoReporte", "DescripcionTipoReporte", reporte.FKTipoReporte);
            ViewBag.Cedula          = reporte.CedulaQuienReporta;
            ViewBag.Consecutivo     = reporte.ConsecutivoReporte;
            ViewBag.fechaSistena    = DateTime.Now.ToString("dd/MM/yyyy").Replace('-', '/');
            ViewBag.FechaOcurrencia = reporte.FechaOcurrencia.ToString("dd/MM/yyyy").Replace('-', '/');
            ViewBag.Descripcion     = reporte.DescripcionReporte;
            ViewBag.Causa           = reporte.CausaReporte;
            ViewBag.Sugerencia      = reporte.SugerenciasReporte;
            ObtenerSiarp(Convert.ToString(reporte.CedulaQuienReporta));
            ViewBag.Cargo  = cargo.ToLower();
            ViewBag.Nombre = nombre.ToLower();
            ViewBag.ruta   = rutaImagenesReportesCI + usuarioActual.NitEmpresa + "/";
            return(View(reporte));
        }
        public JsonResult CrearDeclaracionDocumento(String CodigoDocumento, String Proveedor, DateTime FechaDocumento, int Monto,
                                                    String DescripcionDocumento, int Categoria, String TipoDocumento, IFormFile Archivo)
        {
            string  msj, titulo;
            bool    validar;
            Proceso proceso        = HttpContext.Session.GetComplexData <Proceso>("Proceso");
            String  IdParticipante = HttpContext.Session.GetComplexData <String>("IdParticipante");
            int     IdDocumento    = 1;

            proceso.Solicitud.Participantes = ConsultaDeclaracionGastos.LeerDocumentos(proceso.DeclaracionGastos.Id, proceso.Solicitud.Participantes, proceso.Solicitud.Categorias);
            List <Documento> documentos = proceso.Solicitud.Participantes.Find(participante => participante.RUN.Equals(IdParticipante)).Documentos;

            if (documentos != null)
            {
                int      i         = documentos.Count - 1;
                FileInfo archivo   = new FileInfo(documentos[i].CopiaDoc);
                String   nombreDoc = Path.GetFileNameWithoutExtension(archivo.Name);
                IdDocumento = Convert.ToInt32(nombreDoc) + 1;
            }

            Documento DocumentoAux = new Documento()
            {
                CodigoDocumento      = CodigoDocumento,
                Proveedor            = Proveedor,
                FechaDocumento       = FechaDocumento,
                Monto                = Monto,
                DescripcionDocumento = DescripcionDocumento,
                Categoria            = proceso.Solicitud.Categorias.Find(categoria => categoria.Id == Categoria),
                TipoDocumento        = TipoDocumento,
                CopiaDoc             = GuardarArchivoDeclaracionGastos(Archivo, proceso.Solicitud.Id, IdDocumento, IdParticipante)
            };

            DocumentoAux.Id = ConsultaDeclaracionGastos.CrearDocumento(DocumentoAux, IdParticipante, proceso.DeclaracionGastos.Id);

            if (DocumentoAux.Id > 0)
            {
                validar = true;
                titulo  = "Datos guardados exitosamente";
                msj     = "Los datos se han guardado exitosamente";
            }
            else if (DocumentoAux.Id == -2)
            {
                System.IO.File.Delete(DocumentoAux.CopiaDoc);
                validar = false;
                titulo  = "Se ha producido un problema";
                msj     = "Los datos no se han registrado correctamente. Esto se debe a que ya se encuentra registrado un documento con el mismo código y proveedor.";
            }
            else
            {
                validar = false;
                titulo  = "Se ha producido un problema";
                msj     = "Los datos no se han guardado correctamente. Verifique que tenga conexión a internet e intentelo nuevamente. Si el problema persiste favor de contactarse con soporte.";
            }

            var datos = new
            {
                validar,
                titulo,
                msj
            };

            return(Json(datos));
        }
        public JsonResult EliminarDocumentosPaticipante(String IdParticipante)
        {
            //Usuario usuario = HttpContext.Session.GetComplexData<UsuarioRepresentante>("DatosUsuario");
            String tipoUsuario = HttpContext.Session.GetString("TipoUsuario");

            if (tipoUsuario.Equals("Estudiante dirigente"))
            {
                Usuario             usuario        = HttpContext.Session.GetComplexData <Usuario>("DatosUsuario");
                List <Organizacion> organizaciones = ConsultaUsuario.LeerOrganizacion(usuario.Id, tipoUsuario);
                Organizacion        organizacion   = organizaciones[0];

                Proceso proceso = HttpContext.Session.GetComplexData <Proceso>("Proceso");
                proceso.Solicitud.Participantes = ConsultaDeclaracionGastos.LeerDocumentos(proceso.DeclaracionGastos.Id, proceso.Solicitud.Participantes, proceso.Solicitud.Categorias);
                if (IdParticipante == null)
                {
                    IdParticipante = HttpContext.Session.GetComplexData <String>("IdParticipante");
                }

                string webRootPath = _webHostEnvironment.WebRootPath;

                try
                {
                    int  cantParticipantes = proceso.Solicitud.Participantes.Count();
                    bool existenDocumentosParticipantes = false;
                    for (int i = 0; i < cantParticipantes; i++)
                    {
                        if (!proceso.Solicitud.Participantes[i].RUN.Equals(IdParticipante) && proceso.Solicitud.Participantes[i].Documentos != null && proceso.Solicitud.Participantes[i].Documentos.Count() > 0)
                        {
                            existenDocumentosParticipantes = true;
                        }
                    }

                    int validar = ConsultaDeclaracionGastos.EliminarDocumentosParticipante(proceso.DeclaracionGastos.Id, IdParticipante);

                    if (validar == 1)
                    {
                        string rutaCarpetaParticiapnte = Path.Combine(webRootPath, "Procesos", organizacion.Nombre, proceso.Solicitud.FechaTerminoEvento.Year.ToString(), proceso.Solicitud.Id.ToString(), "DeclaracionGastos", IdParticipante);
                        string rutaCarpetaDG           = Path.Combine(webRootPath, "Procesos", organizacion.Nombre, proceso.Solicitud.FechaTerminoEvento.Year.ToString(), proceso.Solicitud.Id.ToString(), "DeclaracionGastos");

                        if (existenDocumentosParticipantes && Directory.Exists(rutaCarpetaParticiapnte))
                        {
                            Directory.Delete(rutaCarpetaParticiapnte, true);
                            return(Json("1"));
                        }
                        else if (!existenDocumentosParticipantes && Directory.Exists(rutaCarpetaDG))
                        {
                            Directory.Delete(rutaCarpetaDG, true);
                            return(Json("1"));
                        }
                        else
                        {
                            return(Json("0"));
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            return(Json("-1"));
        }
        public JsonResult EliminarDocumento(int IdDocumento)
        {
            string msj, titulo, carpetaDeclaracionGasto = "", carpetaRepresentante = "";
            /*Obtiene el ID del participante al cual se le eliminara el documento*/
            String IdParticipante = HttpContext.Session.GetComplexData <String>("IdParticipante");
            /*Obtiene los datos del proceso en general*/
            Proceso proceso = HttpContext.Session.GetComplexData <Proceso>("Proceso");
            /*Lee los documentos y se los asigna a los perticipantes correspondientes*/
            List <Persona> participantes = ConsultaDeclaracionGastos.LeerDocumentos(proceso.DeclaracionGastos.Id, proceso.Solicitud.Participantes, proceso.Solicitud.Categorias);

            int       cantDocumentos             = 0;
            int       cantParticipantes          = participantes.Count();
            int       cantDocumentosParticipante = 0;
            Documento documento       = null;
            int       respEliminacion = -1;
            Boolean   validar         = false;

            try
            {
                for (int i = 0; i < cantParticipantes; i++)
                {
                    cantDocumentos += participantes[i].Documentos.Count();
                    if (participantes[i].RUN.Equals(IdParticipante))
                    {
                        cantDocumentosParticipante = participantes[i].Documentos.Count();
                        documento = participantes[i].Documentos.Find(documento => documento.Id == IdDocumento);
                    }
                }

                /*Eliminacion del documento*/
                if (documento != null)
                {
                    /*Elimina un documento en particular*/
                    respEliminacion = ConsultaDeclaracionGastos.EliminarDocumento(IdDocumento);
                    if (respEliminacion == 1)
                    {
                        System.IO.File.Delete(documento.CopiaDoc);
                    }
                }

                /*Eliminacion de carpetas en caso de que no existan documentos asociados tanto al participante como a la declaracion de gastos*/
                string[] ruta = documento.CopiaDoc.Split("\\");

                for (int i = 0; i < ruta.Length - 1; i++)
                {
                    if (i < ruta.Length - 2)
                    {
                        carpetaDeclaracionGasto = Path.Combine(carpetaDeclaracionGasto, ruta[i]);
                    }
                    carpetaRepresentante = Path.Combine(carpetaRepresentante, ruta[i]);
                }

                /*Borrara la carpeta que contiene los documentos del participante*/
                if (cantDocumentosParticipante == 1 && respEliminacion == 1)
                {
                    System.IO.Directory.Delete(carpetaRepresentante);
                }

                /*Borrara la carpeta de Declaracion de gastos que contiene los documentos(Boletas o facturas)*/
                if (cantDocumentos == 1 && respEliminacion == 1)
                {
                    System.IO.Directory.Delete(carpetaDeclaracionGasto);
                }

                if (respEliminacion == 1)
                {
                    validar = true;
                    titulo  = "Eliminación exitosa";
                    msj     = "Se ha eliminado el documento exitosamente";
                }
                else if (respEliminacion == -1)
                {
                    validar = false;
                    titulo  = "Se ha producido un problema";
                    msj     = "El documento no se ha podido eliminar. Verifique que tenga conexión a internet e intentelo nuevamente. Si el problema persiste favor de contactarse con soporte.";
                }
                else
                {
                    validar = false;
                    titulo  = "Se ha producido un problema";
                    msj     = "El documento no se ha podido eliminar. Puede que exista un problema en la funcion que elimina el documento en la base de datos. Favor de contactarse con soporte.";
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                validar = false;
                titulo  = "Error";
                msj     = "Es probable que no se pueda eliminar el documento debido a que la carpeta donde se encuentra el documento no se encuentre vacia.";
            }
            var datos = new
            {
                validar,
                titulo,
                msj
            };

            return(Json(datos));
        }
        public JsonResult ModificarDocumento(String CodigoDocumento, String Proveedor, DateTime FechaDocumento, int Monto,
                                             String DescripcionDocumento, int Categoria, String TipoDocumento, IFormFile Archivo, Boolean CambioArchivo)
        {
            String msj, titulo, rutaDoc;
            bool   validar;

            Proceso proceso        = HttpContext.Session.GetComplexData <Proceso>("Proceso");
            String  IdParticipante = HttpContext.Session.GetComplexData <String>("IdParticipante");
            int     IdDocumento    = HttpContext.Session.GetComplexData <int>("IdDocumento");

            proceso.Solicitud.Participantes = ConsultaDeclaracionGastos.LeerDocumentos(proceso.DeclaracionGastos.Id, proceso.Solicitud.Participantes, proceso.Solicitud.Categorias);
            Documento documento = proceso.Solicitud.Participantes.Find(participante => participante.RUN.Equals(IdParticipante)).Documentos.Find(documento => documento.Id == IdDocumento);

            if (documento.CodigoDocumento != CodigoDocumento || documento.Proveedor != Proveedor || documento.FechaDocumento != FechaDocumento || documento.Monto != Monto ||
                documento.DescripcionDocumento != DescripcionDocumento || documento.Categoria.Id != Categoria || documento.TipoDocumento != TipoDocumento || CambioArchivo)
            {
                rutaDoc = documento.CopiaDoc;
                if (CambioArchivo)
                {
                    System.IO.File.Delete(documento.CopiaDoc);
                    Path.GetFileNameWithoutExtension(documento.CopiaDoc);
                    int nombreDoc = Convert.ToInt32(Path.GetFileNameWithoutExtension(documento.CopiaDoc));
                    rutaDoc = GuardarArchivoDeclaracionGastos(Archivo, proceso.Solicitud.Id, nombreDoc, IdParticipante);
                }

                Documento DocumentoAux = new Documento()
                {
                    Id = documento.Id,
                    CodigoDocumento      = CodigoDocumento,
                    Proveedor            = Proveedor,
                    FechaDocumento       = FechaDocumento,
                    Monto                = Monto,
                    DescripcionDocumento = DescripcionDocumento,
                    Categoria            = proceso.Solicitud.Categorias.Find(categoria => categoria.Id == Categoria),
                    TipoDocumento        = TipoDocumento,
                    CopiaDoc             = rutaDoc
                };

                int respuesta = ConsultaDeclaracionGastos.ModificarDocumento(DocumentoAux);

                if (respuesta == 1)
                {
                    validar = true;
                    titulo  = "Datos modificados exitosamente";
                    msj     = "Los datos se han modificado exitosamente";
                }
                else
                {
                    validar = false;
                    titulo  = "Se ha producido un problema";
                    msj     = "Los datos no se han modificado correctamente. Verifique que tenga conexión a internet e intentelo nuevamente. Si el problema persiste favor de contactarse con soporte.";
                }
            }
            else
            {
                validar = true;
                titulo  = "No existen cambios";
                msj     = "No se han guardados los datos debido a que no existen cambios";
            }
            var datos = new
            {
                validar,
                titulo,
                msj
            };

            return(Json(datos));
        }
        public JsonResult TipoEvento()
        {
            Proceso proceso = HttpContext.Session.GetComplexData <Proceso>("Proceso");

            return(Json(proceso.Solicitud.TipoEvento));
        }
Пример #19
0
        private void EscribirXML_correoFallo(StreamWriter sw, Proceso proceso)
        {
            sw.WriteLine("    <correoFallo>");
            sw.WriteLine("      <credentials_user value=\"" + proceso.mensajeFallo.correo.Getuser() + "\" />");
            sw.WriteLine("      <credentials_pass value=\"" + proceso.mensajeFallo.correo.Getpass() + "\" />");
            sw.WriteLine("      <host value=\"" + proceso.mensajeFallo.correo.Gethost() + "\" />");
            sw.WriteLine("      <port value=\"" + proceso.mensajeFallo.correo.Getport().ToString() + "\" />");
            sw.WriteLine("      <asunto value=\"" + proceso.mensajeFallo.correo.Getasunto() + "\" />");
            sw.WriteLine("      <lapsomin value=\"" + proceso.mensajeFallo.GetLapso().ToString() + "\" />");

            sw.WriteLine("      <para>");
            foreach (string item in proceso.mensajeFallo.correo.Getpara())
            {
                sw.WriteLine("        <correo value=\"" + item + "\" />");
            }

            if (!proceso.mensajeFallo.correo.Getpara().Any())
            {
                sw.WriteLine("        <correo value=\"\" />");
            }

            sw.WriteLine("      </para>");

            sw.WriteLine("      <smsservidor value=\"" + proceso.mensajeFallo.sms.servidor + "\" />");
            sw.WriteLine("      <smsusuario value=\"" + proceso.mensajeFallo.sms.usuarioClienteEmpresa + "\" />");
            sw.WriteLine("      <smsclaveusuario value=\"" + proceso.mensajeFallo.sms.claveUsuario + "\" />");

            sw.WriteLine("      <smspara>");
            foreach (string item in proceso.mensajeFallo.sms.numeros)
            {
                sw.WriteLine("        <numero value=\"" + item + "\" />");
            }

            if (!proceso.mensajeFallo.sms.numeros.Any())
            {
                sw.WriteLine("        <numero value=\"\" />");
            }
            sw.WriteLine("      </smspara>");

            sw.WriteLine("    </correoFallo>");
        }
Пример #20
0
 private void EscribirXML_ftp(StreamWriter sw, Proceso proceso)
 {
     sw.WriteLine("    <ftp>");
     sw.WriteLine("      <Host value=\"" + proceso.ftp.GetftpHost() + "\" />");
     sw.WriteLine("      <User value=\"" + proceso.ftp.GetftpUserName() + "\" />");
     sw.WriteLine("      <Password value=\"" + proceso.ftp.GetftpPassword() + "\" />");
     sw.WriteLine("      <Dominio value=\"" + proceso.ftp.GetftpDominioSFTP() + "\" />");
     sw.WriteLine("      <TLS value=\"" + proceso.ftp.GetftpTLS().ToString() + "\" />");
     sw.WriteLine("      <SSL value=\"" + proceso.ftp.GetftpSSL().ToString() + "\" />");
     sw.WriteLine("    </ftp>");
 }
Пример #21
0
        public FacturaReporte(String tipoDocu, String tipoReport)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(100, 0);
            tipoDocumento      = tipoDocu;
            tipoReporte        = tipoReport;
            objProceso         = new Proceso();
            this.ControlBox    = false;
            this.Text          = "REPORTE FACTURAS";
            gridParams();
            objMoneda              = new MonedaDAO();
            objDocumentoDao        = new DocumentoDAO();
            grd_Detalle.CellClick += Grd_Detalle_CellClick;
            if (tipoReporte == "F")
            {
                txt_Ruc.Text       = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_Cliente.Text   = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabCliente;
                txt_Direccion.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteDireccion;
                txt_GlosaCab.Text  = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabGlosa;
                txt_Serie.Text     = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text    = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabNro;
                txt_Moneda.Text    = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabMoneda;
                //  txt_OT.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabOtCod;
                txt_Pago.Text           = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabPago;
                dpick_Fecha.Value       = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFecha;
                dpck_Fechavcto.Value    = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFechaVcto;
                txt_IGV.Text            = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                txt_TotalsinPercep.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                txt_ValorVenta.Text     = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                tipoCambio(dpick_Fecha.Value.ToShortDateString());

                objListDocumentoDet = objDocumentoDao.detalleReporte(ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabSerie,
                                                                     ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabNro, Ventas.UNIDADNEGOCIO);
                grd_Detalle.DataSource = objListDocumentoDet;
                grd_Detalle.Refresh();
                lblTotal.Text = objDocumentoDao.numeroALetras(convertToDouble(ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTotal.ToString())) + " " + txt_Moneda.Text;
                if (ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    lbl_Moneda.Text = "$";
                }
                txt_Detraccion.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabDetraccion.ToString();
                txt_Porcentaje.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Guia.Text       = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabGuia;
                txt_Pedido.Text     = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabOrdenCompra;
            }
            else if (tipoReporte == "C")
            {
                txt_Ruc.Text            = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_Cliente.Text        = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabCliente;
                txt_Direccion.Text      = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteDireccion;
                txt_GlosaCab.Text       = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabGlosa;
                txt_Serie.Text          = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text         = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabNro;
                txt_Moneda.Text         = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabMoneda;
                txt_OT.Text             = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabOtCod;
                txt_Pago.Text           = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabPago;
                dpick_Fecha.Value       = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabFecha;
                dpck_Fechavcto.Value    = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabFechaVcto;
                txt_IGV.Text            = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                txt_TotalsinPercep.Text = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                txt_ValorVenta.Text     = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                tipoCambio(dpick_Fecha.Value.ToShortDateString());

                objListDocumentoDet = objDocumentoDao.detalleReporte(ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabSerie,
                                                                     ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabNro, Ventas.UNIDADNEGOCIO);
                grd_Detalle.DataSource = objListDocumentoDet;
                grd_Detalle.Refresh();
                lblTotal.Text = objDocumentoDao.numeroALetras(convertToDouble(ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabTotal.ToString())) + " " + txt_Moneda.Text;
                if (ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    lbl_Moneda.Text = "$";
                }
                txt_Detraccion.Text = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabDetraccion.ToString();
                txt_Porcentaje.Text = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Guia.Text       = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabGuia;
                txt_Pedido.Text     = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabOrdenCompra;
            }
        }
Пример #22
0
        private void LeerXML_correoFallo(Proceso proceso, XmlNode xmlroot)
        {
            string credentials_user = xmlroot["credentials_user"].Attributes["value"].Value;
            string credentials_pass = xmlroot["credentials_pass"].Attributes["value"].Value;
            string host = xmlroot["host"].Attributes["value"].Value;
            int port = Int32.TryParse(xmlroot["port"].Attributes["value"].Value, out port) ? port : 0;
            string asunto = xmlroot["asunto"].Attributes["value"].Value;
            int lapso = Int32.TryParse(xmlroot["lapsomin"].Attributes["value"].Value, out lapso) ? lapso : 0;

            XmlNodeList nodos = xmlroot["para"].ChildNodes;

            XmlNode nodoTemp;

            string body = "Correo fallo";

            IList<string> para = new List<string>();

            proceso.AgregarParametros_correoFallo(credentials_user, credentials_pass, host, port, asunto, body, lapso);

            for (int i = 0; i < nodos.Count; i++)
            {
                nodoTemp = nodos.Item(i);
                if (nodoTemp.Name.Equals("correo"))
                {
                    para.Add(nodoTemp.Attributes["value"].Value);
                }

            }

            foreach (string item in para)
            {
                proceso.mensajeFallo.correo.AgregarPara(item);
            }

            /////////////////////SMS////////////////
            try
            {
                string smsservidor = xmlroot["smsservidor"].Attributes["value"].Value;
                string smsusuario = xmlroot["smsusuario"].Attributes["value"].Value;
                string smsclaveusuario = xmlroot["smsclaveusuario"].Attributes["value"].Value;

                string mensaje = MensajeFalloSMS(proceso.nombre,proceso.nombrearchivo);

                proceso.mensajeFallo.AgregarParamSMS(smsservidor, smsusuario, smsclaveusuario, mensaje);

                XmlNodeList nodosSMS = xmlroot["smspara"].ChildNodes;

                XmlNode nodoSMSTemp;

                IList<string> numeros = new List<string>();

                for (int i = 0; i < nodosSMS.Count; i++)
                {
                    nodoSMSTemp = nodosSMS.Item(i);
                    if (nodoSMSTemp.Name.Equals("numero"))
                    {
                        numeros.Add(nodoSMSTemp.Attributes["value"].Value);
                    }

                }

                foreach (string item in numeros)
                {
                    proceso.mensajeFallo.sms.AgregarNumero(item);
                }

            }
            catch (Exception exsms)
            {

            }
        }
        public bool ProcesarDependenciasWS(ProcesoDto ProcDto, string Ruta)
        {
            bool             respuesta = false;
            ParseadorWS      PWS       = new ParseadorWS();
            ProcesoAvanceDto pdtoA     = new ProcesoAvanceDto();
            Proceso          proc      = new Proceso();

            try
            {
                if (validadatos(ProcDto.UsuarioID, ProcDto.ProcesoID, Ruta))
                {
                    DataTable LenguajeApp = proc.ConsultaLenguaje(Convert.ToString(ProcDto.AplicacionID));
                    if (LenguajeApp == null || LenguajeApp.Rows.Count < 1)
                    {
                        ErrLog.EscribeLogWS("No se encontraron los datos de lenguaje de la Aplicación");
                        LenguajeApp = null;
                    }
                    else
                    {
                        DataRow Lenguaje = LenguajeApp.Rows[0];
                        string  Tipo     = Lenguaje["Extension"].ToString();
                        if (Tipo == "cs")
                        {
                            Tipo = "*.config";
                        }
                        else if (Tipo == "java")
                        {
                            Tipo = "*.wsdl";
                        }
                        else if (Tipo == "asp")
                        {
                            Tipo = "*.asp";
                        }

                        string[] Archivos = Directory.GetFiles(Ruta, Tipo, SearchOption.AllDirectories);

                        HashSet <string> InventarioWS = new HashSet <string>();

                        proc.SeteaAvance("En Proceso", "OK", "OK", "40", "40", "", "Iniciando Parseo WS", pdtoA, ProcDto);
                        proc.ActualizaProcesoAvance(pdtoA, ProcDto);

                        for (int i = 0; i <= Archivos.Count() - 1; i++)
                        {
                            InventarioWS = PWS.GenerarInventarioWS(Archivos[i], ProcDto, Tipo);
                        }

                        proc.SeteaAvance("En Proceso", "OK", "OK", "42", "40", "", "Inventario de WS Generado", pdtoA, ProcDto);
                        proc.ActualizaProcesoAvance(pdtoA, ProcDto);

                        Tipo     = "*." + Lenguaje["Extension"].ToString();
                        Archivos = Directory.GetFiles(Ruta, Tipo, SearchOption.AllDirectories);

                        PWS.GenerarSalidaWS(InventarioWS, Archivos, ProcDto.AplicacionID.ToString(), ProcDto);
                        proc.SeteaAvance("En Proceso", "OK", "OK", "70", "70", "", "Parseo WS Terminado", pdtoA, ProcDto);
                        proc.ActualizaProcesoAvance(pdtoA, ProcDto);
                        respuesta = true;
                    }
                }
            }
            catch (Exception Err)
            {
                ErrLog.EscribeLogWS("WSInterfacesWebService.ProcesaDependenciasWS " + Err.Message.ToString());
            }
            return(respuesta);
        }
Пример #24
0
        private void LeerXML_validar(Proceso proceso, XmlNode xmlroot)
        {
            int hora = Int32.TryParse(xmlroot["data"].Attributes["hora"].Value, out hora) ? hora : 0;
            int min = Int32.TryParse(xmlroot["data"].Attributes["min"].Value, out min) ? min : 0;

            int horafin = Int32.TryParse(xmlroot["datafin"].Attributes["hora"].Value, out horafin) ? horafin : 0;
            int minfin = Int32.TryParse(xmlroot["datafin"].Attributes["min"].Value, out minfin) ? minfin : 0;

            proceso.AgregarParametros_Validar(hora, min, horafin, minfin);
        }
Пример #25
0
        private void btnImprimirDetalle_Click(object sender, EventArgs e)
        {
            usuario = cbUsuario.SelectedIndex;
            proceso = cbProcesos.SelectedIndex;


            string usu = cbUsuario.SelectedValue.ToString();
            string pro = cbProcesos.SelectedValue.ToString();

            // FILTRADO POR TODOS
            if (usuario == 0 & proceso == 0)
            {
                //Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Has seleccionado todos");
                //timer1.Start();

                Proceso   objProceso = new Proceso();
                DataTable dtReporte;
                dtReporte = objProceso.ReporteProcesosUsuarios("%", "%", "", "", "", 6);

                switch (dtReporte.Rows.Count)
                {
                case 0:
                    DialogResult result = MessageBox.Show("Consulta Sin Resultados", "SIPAA");
                    break;

                default:
                    ViewerReporte           form      = new ViewerReporte();
                    ReporteProcesosUsuarios dtrpt     = new ReporteProcesosUsuarios();
                    ReportDocument          ReportDoc = Utilerias.ObtenerObjetoReporte(dtReporte, this.CompanyName, dtrpt.ResourceName);

                    ReportDoc.SetParameterValue("TotalRegistros", dtReporte.Rows.Count.ToString());
                    //ReportDoc.SetParameterValue("Filtro", cbEstatus.SelectedItem.ToString());
                    form.RptDoc = ReportDoc;
                    form.Show();
                    break;
                }
            }
            // FILTRA POR USUARIO Y PROCESO SELECCIONADO
            else if (usuario > 0 && proceso > 0)
            {
                //Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Has seleccionado todos");
                //timer1.Start();

                Proceso   objProceso = new Proceso();
                DataTable dtReporte;
                dtReporte = objProceso.ReporteProcesosUsuarios(usu, pro, "", "", "", 6);

                switch (dtReporte.Rows.Count)
                {
                case 0:
                    DialogResult result = MessageBox.Show("Consulta Sin Resultados", "SIPAA");
                    break;

                default:
                    ViewerReporte           form      = new ViewerReporte();
                    ReporteProcesosUsuarios dtrpt     = new ReporteProcesosUsuarios();
                    ReportDocument          ReportDoc = Utilerias.ObtenerObjetoReporte(dtReporte, this.CompanyName, dtrpt.ResourceName);

                    ReportDoc.SetParameterValue("TotalRegistros", dtReporte.Rows.Count.ToString());
                    //ReportDoc.SetParameterValue("Filtro", cbEstatus.SelectedItem.ToString());
                    form.RptDoc = ReportDoc;
                    form.Show();
                    break;
                }
            }

            //FILTRA POR USUARIO
            else if (usuario > 0 && proceso == 0)
            {
                //Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Has seleccionado todos");
                //timer1.Start();

                Proceso   objProceso = new Proceso();
                DataTable dtReporte;
                dtReporte = objProceso.ReporteProcesosUsuarios(usu, "%", "", "", "", 6);

                switch (dtReporte.Rows.Count)
                {
                case 0:
                    DialogResult result = MessageBox.Show("Consulta Sin Resultados", "SIPAA");
                    break;

                default:
                    ViewerReporte           form      = new ViewerReporte();
                    ReporteProcesosUsuarios dtrpt     = new ReporteProcesosUsuarios();
                    ReportDocument          ReportDoc = Utilerias.ObtenerObjetoReporte(dtReporte, this.CompanyName, dtrpt.ResourceName);

                    ReportDoc.SetParameterValue("TotalRegistros", dtReporte.Rows.Count.ToString());
                    //ReportDoc.SetParameterValue("Filtro", cbEstatus.SelectedItem.ToString());
                    form.RptDoc = ReportDoc;
                    form.Show();
                    break;
                }
            }

            //FILTRA POR PROCESO

            else if (usuario == 0 && proceso > 0)
            {
                //Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Has seleccionado todos");
                //timer1.Start();

                Proceso   objProceso = new Proceso();
                DataTable dtReporte;
                dtReporte = objProceso.ReporteProcesosUsuarios("%", pro, "", "", "", 6);

                switch (dtReporte.Rows.Count)
                {
                case 0:
                    DialogResult result = MessageBox.Show("Consulta Sin Resultados", "SIPAA");
                    break;

                default:
                    ViewerReporte           form      = new ViewerReporte();
                    ReporteProcesosUsuarios dtrpt     = new ReporteProcesosUsuarios();
                    ReportDocument          ReportDoc = Utilerias.ObtenerObjetoReporte(dtReporte, this.CompanyName, dtrpt.ResourceName);

                    ReportDoc.SetParameterValue("TotalRegistros", dtReporte.Rows.Count.ToString());
                    //ReportDoc.SetParameterValue("Filtro", cbEstatus.SelectedItem.ToString());
                    form.RptDoc = ReportDoc;
                    form.Show();
                    break;
                }
            }
        }
Пример #26
0
        private void creatGrafico( Proceso [] vectorProc )
        {
            // graficar el vector de procesos

            int acumulado = 0;
            int anterior = 0;
            // graficar cada proceso en el vector
            for (int i = 0; i < vectorProc.Length; i++)
            {
                // agregar serie al grafico
                Series serie = gant.Series.Add(vectorProc[i].GSnombre);

                // cambiar tipo de grafico
                serie.ChartType = SeriesChartType.Point;
                int exp = acumulado  + 1 ;

                // poner todos los puntos en la grafica para una serie
                for (int j = (acumulado + 1); j <= (acumulado + vectorProc[i].GSduracion); j++)
                {
                    serie.Points.AddXY(j, i + 1);
                }
                acumulado += (vectorProc[i].GSduracion);
            }
        }
Пример #27
0
        public static string ProcesoEjecutarToQuickBook(Proceso proceso)
        {
            try
            {
                StringBuilder mostrarMensaje = new StringBuilder();


                Quickbook.Config.IsProduction = true;
                Quickbook.Config.SaveLogXML   = Properties.Settings.Default.qbook_save_log;
                Quickbook.Config.App_Name     = Properties.Settings.Default.qbook_app_name;
                Quickbook.Config.File         = proceso.file;
                Quickbook.Config.CompaniaDB   = proceso.companiaDB;

                Quickbook.Config.quickbooks = new Connector(Quickbook.Config.App_Name, Quickbook.Config.File);
                if (Config.quickbooks.Connect())
                {
                    foreach (ProcesoAccion accion in proceso.acciones)
                    {
                        //Revisando si tenemos respuesta creada a esta altura
                        if (accion.tipo == "add_quickbase")
                        {
                            mostrarMensaje.Append("Ejecutando accion " + accion.nombre + Environment.NewLine);

                            if (accion.quickbookTabla != string.Empty)
                            {
                                try
                                {
                                    string fullPath = System.IO.Directory.GetCurrentDirectory();

                                    Assembly testAssembly = Assembly.LoadFile(fullPath + "\\Quickbook.dll");

                                    Type difineType = testAssembly.GetType("Quickbook." + accion.quickbookTabla);

                                    // create instance of class Calculator
                                    object objQuickbookInstance = Activator.CreateInstance(difineType);
                                    //que campos
                                    string          err     = string.Empty;
                                    List <Abstract> Records = new List <Abstract>();

                                    if (proceso.tipoEjecucion == "manual")
                                    {//TODO:AComodar GEnerico
                                        Records = ((Abstract)objQuickbookInstance).GetRecordsCVS(ref err, proceso.includeSublevel);
                                    }
                                    else
                                    {
                                        Records = ((Abstract)objQuickbookInstance).GetRecords(ref err, proceso.includeSublevel);
                                    }


                                    if (Records.Count > 0)
                                    {
                                        //obtener el listado de quickbase, separar los que tienen listID
                                        mostrarMensaje.Append(HelperProcesor.ProcesarRegistros(proceso, Records));
                                    }
                                    else
                                    {
                                        mostrarMensaje.Append("No se encontraron registros para sincronizar" + Environment.NewLine);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    mostrarMensaje.Append("Error al procesar:" + ex.Message + Environment.NewLine);
                                }
                            }
                        }
                    }

                    mostrarMensaje.Append("desconectando.....");
                    Config.quickbooks.Disconnect();
                }
                else
                {
                    mostrarMensaje.Append("Error no conecto a Quickbooks");
                }
                return(mostrarMensaje.ToString());
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
Пример #28
0
        public static string ProcesoEjecutarToQuickBase(Proceso proceso)
        {
            //  Access
            // Procesar Entrada..
            StringBuilder mostrarMensaje = new StringBuilder();


            var    ws   = new wClient.WService();
            string err  = "";
            string resp = ws.doQuery(proceso.entrada.quickbaseAccessToken, null, out err);

            Quickbook.Config.App_Name   = Properties.Settings.Default.qbook_app_name;
            Quickbook.Config.File       = proceso.file;
            Quickbook.Config.CompaniaDB = proceso.companiaDB;

            Quickbook.Config.IsProduction = true;

            if (err != string.Empty)
            {
                mostrarMensaje.Append("Ejecutando accion Error en el servicio:" + err + Environment.NewLine);
            }

            var serializer = new JavaScriptSerializer();

            serializer.MaxJsonLength = Int32.MaxValue;
            List <List <Par> > data = null;

            try
            {
                data = serializer.Deserialize <List <List <Par> > >(resp);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                mostrarMensaje.Append("Ejecutando accion Error des serializando:" + ex.Message + Environment.NewLine);
            }
            if (data == null)
            {
                mostrarMensaje.Append("Ejecutando accion data:null" + Environment.NewLine);
            }
            else
            {
                mostrarMensaje.Append("Ejecutando accion cantidad a procesar:" + data.Count + Environment.NewLine);
            }

            if (data != null && data.Count > 0)
            {
                // Inicializar Conexion a Quickbook
                Config.quickbooks = new Connector(Quickbook.Config.App_Name, Quickbook.Config.File);
                if (Config.quickbooks.Connect())
                {
                    foreach (ProcesoAccion accion in proceso.acciones)
                    {
                        //Revisando si tenemos respuesta creada a esta altura
                        if (accion.tipo == "add_quickbook")
                        {
                            mostrarMensaje.Append("Ejecutando accion " + accion.nombre + Environment.NewLine);


                            //creando la coleccion que almacenara las respuestas de la accion.
                            List <ProcesoRespuesta>             ConfiguracionRespuestaSave = accion.respuestas.FindAll(d => d.categoria == "Save");
                            List <ProcesoRespuesta>             ConfiguracionRespuestaLog  = accion.respuestas.FindAll(d => d.categoria == "Log");
                            Dictionary <string, List <string> > RespuestasSave             = new Dictionary <string, List <string> >();
                            Dictionary <string, List <string> > RespuestasLog = new Dictionary <string, List <string> >();
                            string llaveQuickbook = "";
                            Dictionary <string, string> llaveQuickbase = new Dictionary <string, string>();

                            //obtener los campos de respuesta para los parametros a enviar
                            //el token sera la llave
                            Dictionary <string, string> fieldNameExternals = HelperTask.GetFieldNameKeyExternal(ConfiguracionRespuestaSave);



                            for (int j = 0; j < data.Count; j++)
                            {
                                // Para Key => Value retornado desde Quickbase ;
                                Hashtable pairs = Generic.getPairValues(data[j]);

                                // Obtener la coleccion Fields => Value que se asignara al Objeto
                                List <string> fieldNames     = new List <string>();
                                List <object> fieldValues    = new List <object>();
                                string        fieldRiquiered = string.Empty;
                                bool          Requiered      = false;
                                //Get the Values to add to quickbook
                                HelperTask.GetValuesToAdd(accion, pairs, ref fieldNames, ref fieldValues, ref fieldNameExternals, ref llaveQuickbase, ref fieldRiquiered, ref Requiered, ref mostrarMensaje, ref err);

                                // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

                                string xmlSend    = string.Empty;
                                string xmlRecived = string.Empty;


                                if (accion.quickbookTabla != string.Empty)
                                {
                                    if (Requiered == false)
                                    {
                                        try
                                        {
                                            string fullPath = System.IO.Directory.GetCurrentDirectory();

                                            Assembly testAssembly = Assembly.LoadFile(fullPath + "\\Quickbook.dll");

                                            Type difineType = testAssembly.GetType("Quickbook." + accion.quickbookTabla);

                                            // create instance of class Calculator
                                            object   objQuickbookInstance = Activator.CreateInstance(difineType);
                                            Abstract ObjectQuickbook      = (Abstract)Generic.SetFields(fieldNames, fieldValues, objQuickbookInstance, ref err);
                                            if (ObjectQuickbook.HasChild)
                                            {
                                                if (pairs["CHILDS"] != null)
                                                {
                                                    string pairsDetails = pairs["CHILDS"].ToString();

                                                    HelperTask.CargadoDetalle(ObjectQuickbook, accion, pairsDetails, ref err);
                                                }
                                            }
                                            if (ObjectQuickbook != null && ObjectQuickbook.AddRecord(ref err, ref xmlSend, ref xmlRecived))
                                            {
                                                if (ConfiguracionRespuestaSave.Count > 0)
                                                {
                                                    HelperTask.AddConfigSave(ConfiguracionRespuestaSave, llaveQuickbase, ObjectQuickbook, ref err, ref RespuestasSave);
                                                }
                                            }
                                            else
                                            {
                                                if (err == string.Empty)
                                                {
                                                    if (ConfiguracionRespuestaLog.Count > 0)
                                                    {
                                                        xmlSend = xmlSend.Replace(",", ".");
                                                        xmlSend = xmlSend.Replace(Environment.NewLine, "");



                                                        xmlRecived = xmlRecived.Replace(",", ".");
                                                        xmlRecived = xmlRecived.Replace(Environment.NewLine, "");

                                                        string accionValue = accion.tipo + proceso.nombre;
                                                        accionValue = accionValue.Replace(" ", "");

                                                        string log = accionValue + "," + xmlSend + "," + xmlRecived + "," + "0";
                                                        HelperTask.AddConfigLog(ConfiguracionRespuestaLog, log, ref RespuestasLog);
                                                    }
                                                }
                                                else
                                                {
                                                    if (ConfiguracionRespuestaLog.Count > 0)
                                                    {
                                                        xmlSend = xmlSend.Replace(",", ".");
                                                        xmlSend = xmlSend.Replace(Environment.NewLine, "");
                                                        err     = err.Replace(",", ".");
                                                        err     = err.Replace(Environment.NewLine, "");
                                                        string accionValue = accion.tipo + proceso.nombre;
                                                        accionValue = accionValue.Replace(" ", "");
                                                        string log = accionValue + "," + xmlSend + "," + err + "," + "0";
                                                        HelperTask.AddConfigLog(ConfiguracionRespuestaLog, log, ref RespuestasLog);
                                                    }
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            mostrarMensaje.Append("Error al Procesar los datos: " + ex.Message + Environment.NewLine);
                                        }
                                    }
                                    else
                                    {
                                        if (ConfiguracionRespuestaLog.Count > 0)
                                        {
                                            string accionValue = accion.tipo + proceso.nombre;
                                            accionValue = accionValue.Replace(" ", "");
                                            string log = accionValue + "," + fieldRiquiered + "," + "Se requiere el campo se encuentra vacio o null" + "," + "0";
                                            HelperTask.AddConfigLog(ConfiguracionRespuestaLog, log, ref RespuestasLog);
                                        }
                                    }
                                }
                            }
                            mostrarMensaje.Append(HelperTask.ImportToQuickBase(ConfiguracionRespuestaSave, ConfiguracionRespuestaLog, RespuestasSave, RespuestasLog, ref err));
                        }
                    }
                    Config.quickbooks.Disconnect();
                }
                else
                {
                    mostrarMensaje.Append("Error no conecto a Quickbooks");
                }


                //  Fin conexion a Quickbook
            }
            return(mostrarMensaje.ToString());
        }
Пример #29
0
        public static string ProcesarRegistros(Proceso proceso, List <Abstract> quickbookRecords)
        {
            //  Access
            // Procesar Entrada..
            StringBuilder mostrarMensaje = new StringBuilder();

            var                ws   = new wClient.WService();
            string             err  = "";
            List <List <Par> > data = null;

            if (proceso.entrada.quickbaseAccessToken != string.Empty)
            {
                string resp = ws.doQuery(proceso.entrada.quickbaseAccessToken, null, out err);
                //El query debe ser los que tengan Quickbook si o si

                if (err != string.Empty)
                {
                    mostrarMensaje.Append("Ejecutando accion Error en el servicio:" + err + Environment.NewLine);
                }

                var serializer = new JavaScriptSerializer();
                serializer.MaxJsonLength = Int32.MaxValue;

                try
                {
                    data = serializer.Deserialize <List <List <Par> > >(resp);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    mostrarMensaje.Append("Ejecutando accion Error des serializando:" + ex.Message + Environment.NewLine);
                }
                if (data == null)
                {
                    mostrarMensaje.Append("Ejecutando accion data:null" + Environment.NewLine);
                }
                else
                {
                    mostrarMensaje.Append("Ejecutando accion cantidad a procesar:" + quickbookRecords.Count + Environment.NewLine);
                }
            }


            if (data != null && data.Count > 0)
            {
                // Inicializar Conexion a Quickbook

                foreach (ProcesoAccion accion in proceso.acciones)
                {
                    //Revisando si tenemos respuesta creada a esta altura
                    if (accion.tipo == "add_quickbase")
                    {
                        mostrarMensaje.Append("Ejecutando accion " + accion.nombre + Environment.NewLine);

                        Dictionary <string, string> llaveQuickbase = new Dictionary <string, string>();
                        //procesaremos los registros para actualizar
                        string resultadoActualizacion = HelperTask.UpdateQuickbookToquickbaseVendorCreated(data, accion, llaveQuickbase, ref err, ref quickbookRecords);
                        mostrarMensaje.Append(resultadoActualizacion);

                        //Existen nuevos registros para crear
                        mostrarMensaje.Append("Cantidad de registros a crear:" + quickbookRecords.Count + Environment.NewLine);
                        if (quickbookRecords.Count > 0)
                        {
                            string resultadoCreados = HelperTask.CreateQuickbookToQuickbaseNewVendor(accion, quickbookRecords, ref err);
                            mostrarMensaje.Append(resultadoCreados);
                        }
                    }
                }
                return(mostrarMensaje.ToString());
            }
            else
            {
                mostrarMensaje.Append("Cantidad de registros a crear:" + quickbookRecords.Count);
                if (quickbookRecords.Count > 0)
                {
                    foreach (ProcesoAccion accion in proceso.acciones)
                    {
                        //Revisando si tenemos respuesta creada a esta altura
                        if (accion.tipo == "add_quickbase")
                        {
                            //Existen nuevos registros de quickbook para quickbase
                            string resultadoCreados = HelperTask.CreateQuickbookToQuickbaseNewVendor(accion, quickbookRecords, ref err);
                            mostrarMensaje.Append(resultadoCreados);
                        }
                    }
                }

                return(mostrarMensaje.ToString());
            }
        }
Пример #30
0
        public static string SaveProceso(Proceso model)
        {
            ProcesoData data = new ProcesoData();

            return(data.SaveProceso(model));
        }
Пример #31
0
        private void selDato()
        {
            if (consulta == 34)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    if (Bom.ExisteHilos(dtDatos.CurrentRow.Cells[2].Value.ToString()))
                    {
                        TareaHilo frm = new TareaHilo(dtDatos.CurrentRow.Cells[2].Value.ToString());
                        frm.ShowDialog();
                    }
                    else
                    {
                        dato1 = dtDatos.CurrentRow.Cells[2].Value.ToString();
                        Bom.RealizarTarea(dato1);
                    }
                }
                else
                {
                    dato  = "";
                    dato1 = "";
                }
            }
            if (consulta == 31)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    dato = dtDatos.CurrentRow.Cells[1].Value.ToString();
                }
                else
                {
                    dato  = "";
                    dato1 = "";
                }
            }
            else if (consulta == 18)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    dato  = dtDatos.CurrentRow.Cells[1].Value.ToString();
                    dato1 = dtDatos.CurrentRow.Cells[2].Value.ToString();
                }
                else
                {
                    dato  = "";
                    dato1 = "";
                }
            }
            else
            {
                if (dtDatos.Rows.Count > 0 && consulta != 31)
                {
                    dato = dtDatos.CurrentRow.Cells[0].Value.ToString();
                }
            }
            if (consulta == 40)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    articulo.Clave        = dtDatos.CurrentRow.Cells[0].Value.ToString();
                    articulo.Descr        = dtDatos.CurrentRow.Cells[1].Value.ToString();
                    articulo.Material     = dtDatos.CurrentRow.Cells[2].Value.ToString();
                    articulo.UnidadMedida = dtDatos.CurrentRow.Cells[3].Value.ToString();
                    articulo.Proveedor    = dtDatos.CurrentRow.Cells[4].Value.ToString();
                    articulo.Categoria    = dtDatos.CurrentRow.Cells[5].Value.ToString();
                    articulo.Color        = dtDatos.CurrentRow.Cells[6].Value.ToString();
                }
            }
            if (consulta == 41)
            {
                dato  = dtDatos.CurrentRow.Cells[0].Value.ToString();
                dato1 = dtDatos.CurrentRow.Cells[1].Value.ToString();
                dato2 = dtDatos.CurrentRow.Cells[2].Value.ToString();
            }
            if (consulta == 42)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    articulosPT.Clave     = dtDatos.CurrentRow.Cells[0].Value.ToString();
                    articulosPT.Descr     = dtDatos.CurrentRow.Cells[1].Value.ToString();
                    articulosPT.Categoria = dtDatos.CurrentRow.Cells[2].Value.ToString();
                    articulosPT.Estilo    = dtDatos.CurrentRow.Cells[3].Value.ToString();
                    articulosPT.Linea     = dtDatos.CurrentRow.Cells[4].Value.ToString();
                    articulosPT.Marca     = dtDatos.CurrentRow.Cells[5].Value.ToString();
                }
            }
            if (consulta == 43)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    articulosCot              = new ArticulosCot();
                    articulosCot.Clave        = dtDatos.CurrentRow.Cells[0].Value.ToString();
                    articulosCot.Descr        = dtDatos.CurrentRow.Cells[1].Value.ToString();
                    articulosCot.Ancho        = Convert.ToDecimal(dtDatos.CurrentRow.Cells[2].Value.ToString());
                    articulosCot.Peso         = Convert.ToDecimal(dtDatos.CurrentRow.Cells[3].Value.ToString());
                    articulosCot.Proveedor    = dtDatos.CurrentRow.Cells[4].Value.ToString();
                    articulosCot.UnidadMedida = dtDatos.CurrentRow.Cells[5].Value.ToString();
                }
            }
            if (consulta == 44)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    proceso             = new Proceso();
                    proceso.IdProceso   = dtDatos.CurrentRow.Cells[1].Value.ToString();
                    proceso.Descripción = dtDatos.CurrentRow.Cells[2].Value.ToString();
                }
            }
            if (consulta == 45)
            {
                if (dtDatos.Rows.Count > 0)
                {
                    obra              = new ManodeObra();
                    presupuestos      = new Presupuestos();
                    obra.IdManodeObra = dtDatos.CurrentRow.Cells[1].Value.ToString();
                    obra.Descripción  = dtDatos.CurrentRow.Cells[2].Value.ToString();

                    presupuestos = cotizacion.GetPresupuestos(obra.IdManodeObra);
                }
            }
            this.Close();
        }
Пример #32
0
        static void Main(string[] args)
        {
            Proceso pro    = new Proceso();
            string  opcion = "";

            while (true)
            {
                Console.Clear();
                Console.WriteLine("");
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Magenta;
                Console.Clear();
                Console.WriteLine("«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»««»«»«»«»«»«»«»«»«»«»«»");
                Console.WriteLine("«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»««»«»«»«»«»«»«»«»«»«»«»");
                Console.WriteLine("");
                Console.WriteLine("     °        / °°°°° °°°°°   /°    |      °°°°° °°°°° °  /");
                Console.WriteLine("      °      /    |     |    /--°   |        |     |    °/ ");
                Console.WriteLine("       °    /     |     |   /    °  |        |     |    /  ");
                Console.WriteLine("         ° /    °°°°°      /      ° °°°°°  °°°°°       °   ");
                Console.WriteLine("                                                     °    ");
                Console.WriteLine("");
                Console.WriteLine("«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»««»«»«»«»«»«»«»«»«»«»«»");
                Console.WriteLine("«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»««»«»«»«»«»«»«»«»«»«»«»");
                Console.WriteLine("");
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("               BIENVENIDA(O) A NUESTRO SISTEMA DE DELIVERY");
                Console.WriteLine("  TU ELIJE EL OUTFIT PERFECTO,NOSOTROS TE TENEMOS ¡EL MAQUILLAJE IDEAL!");
                Console.WriteLine("«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»");
                Console.WriteLine("«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»");
                Console.WriteLine("");
                Console.WriteLine("  MENU");
                Console.WriteLine("");
                Console.WriteLine("  1 - Productos y Precio");
                Console.WriteLine("  2 - Realizar Pedidos");
                Console.WriteLine("  3 - Forma de Pago");
                Console.WriteLine("  4 - Factura Cliente");
                Console.WriteLine("  0 - Salir");
                opcion = Console.ReadLine();

                switch (opcion)
                {
                case "1":
                    Console.Clear();
                    Console.BackgroundColor = ConsoleColor.White;
                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    Console.Clear();
                    pro.listarProductos();
                    break;

                case "2":
                    Console.BackgroundColor = ConsoleColor.White;
                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    Console.Clear();
                    pro.crearPedido();
                    break;

                case "3":
                    Console.BackgroundColor = ConsoleColor.White;
                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    Console.Clear();
                    pro.Pagar();
                    break;

                case "4":
                    Console.BackgroundColor = ConsoleColor.DarkBlue;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.Clear();
                    pro.generarFactura();
                    break;

                default:
                    break;
                }
                if (opcion == "0")
                {
                    break;
                }
            }
        }
Пример #33
0
        public ProcesoVO getProceso(int _id)
        {
            Proceso proceso = procesoRepository.getProceso(_id);

            return(procesoUtil.ConvierteEntityToProcesoVO(proceso));
        }
Пример #34
0
 private void EscribirXML_archivoResplado(StreamWriter sw, Proceso proceso)
 {
     sw.WriteLine("    <archivoRespaldo>");
     sw.WriteLine("      <data nombre=\"" + proceso.archivoRespaldo.getNombre() + "\" direccionLocal=\"" + proceso.archivoRespaldo.getDireccion() + "\" />");
     sw.WriteLine("    </archivoRespaldo>");
 }
Пример #35
0
        public static string SaveProceso(Proceso model)
        {
            ServiceData data = new ServiceData();

            return(data.SaveProceso(model));
        }
Пример #36
0
        private void EscribirXML_correoLog(StreamWriter sw, Proceso proceso)
        {
            sw.WriteLine("    <correoLog>");
            sw.WriteLine("      <credentials_user value=\"" + proceso.mensajeLog.correo.Getuser() + "\" />");
            sw.WriteLine("      <credentials_pass value=\"" + proceso.mensajeLog.correo.Getpass() + "\" />");
            sw.WriteLine("      <host value=\"" + proceso.mensajeLog.correo.Gethost() + "\" />");
            sw.WriteLine("      <port value=\"" + proceso.mensajeLog.correo.Getport().ToString() + "\" />");
            sw.WriteLine("      <asunto value=\"" + proceso.mensajeLog.correo.Getasunto() + "\" />");
            sw.WriteLine("      <lapsomin value=\"" + proceso.mensajeLog.GetLapso().ToString() + "\" />");

            sw.WriteLine("      <para>");
            foreach (string item in proceso.mensajeLog.correo.Getpara())
            {
                sw.WriteLine("        <correo value=\"" + item + "\" />");
            }

            if (!proceso.mensajeLog.correo.Getpara().Any())
            {
                sw.WriteLine("        <correo value=\"\" />");
            }

            sw.WriteLine("      </para>");

            sw.WriteLine("    </correoLog>");
        }
        public ID PostEditarListaPaquetesdePaqueteProcesado([FromBody] List <Paquete> ListaDatos)
        {
            if (ListaDatos == null && ListaDatos.Count > 0)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            int  ret              = -1;
            int  Codigo           = 1;
            int  Finalizado       = 0;
            bool ActualizarPedido = false;

            Pedidos Pedido          = ClassBD.ObtenerPedidoByIdRecepcion(ListaDatos[0].idRecepcion);
            Paquete PaqueteSuperior = ClassBD.ObtenerPaqueteById(ListaDatos[0].idPaqueteSuperior);
            Proceso Proceso         = ClassBD.ObtenerProcesoById(ListaDatos[0].idProceso);

            PaqueteSuperior.CodigoPaquete += Proceso.Codigo;

            List <Paquete> SubPaquetesActuales = ClassBD.ObtenerPaquetesByPaqueteSuperior(PaqueteSuperior.idPaquete);

            if (SubPaquetesActuales != null && SubPaquetesActuales.Count > 0)
            {
                foreach (Paquete PaqueteExistente in SubPaquetesActuales)
                {
                    ClassBD.EliminarPaquete(PaqueteExistente.idPaquete);
                }
            }

            foreach (Paquete Pack in ListaDatos)
            {
                Pack.Embarque      = PaqueteSuperior.Embarque;
                Pack.idEstatus     = 1;
                Pack.CodigoPaquete = PaqueteSuperior.CodigoPaquete + Codigo;
                Codigo++;
                Pack.Precio = Pack.Peso * Proceso.PrecioKG;
                if (Pack.idProcesoProduccion == Pedido.idProcesoFinal)
                {
                    Pack.idEstatus   = 4;
                    ActualizarPedido = true;
                }
                ret         = ClassBD.AgregarPaquete(Pack);
                Finalizado += Pack.Finalizado;
            }
            if (Finalizado > 0)
            {
                ClassBD.ActualizarEstatusPaquete(PaqueteSuperior, 3);
            }

            if (ActualizarPedido)
            {
                double    Porcentaje             = 0;
                Recepcion Recep                  = ClassBD.ObtenerRecepcionRecicladoraById(ListaDatos[0].idRecepcion);
                Paquete   ProduccionProcesoFinal = ClassBD.ObtenerProduccionbyProcesoFinal(ListaDatos[0].idRecepcion, Pedido.idProcesoFinal);
                Paquete   BasuraPedidoCompleto   = ClassBD.ObtenerTodaBasuraByidRecepcion(ListaDatos[0].idRecepcion);

                Porcentaje = (100 * (ProduccionProcesoFinal.Peso + BasuraPedidoCompleto.Peso)) / Recep.PesoInterno;
                ClassBD.ActualizarProgresoPedido(Porcentaje, Pedido.idPedidos);
            }

            return(new ID(ret));
        }
Пример #38
0
 private void EscribirXML_validar(StreamWriter sw, Proceso proceso)
 {
     sw.WriteLine("    <validar>");
     sw.WriteLine("      <data hora=\"" + proceso.horaverificacion.ToString() + "\" min=\"" + proceso.minverificacion.ToString() + "\" />");
     sw.WriteLine("      <datafin hora=\"" + proceso.horafinverificacion.ToString() + "\" min=\"" + proceso.minfinverificacion.ToString() + "\" />");
     sw.WriteLine("    </validar>");
 }
        private void timerElapsed_ejecutar(object sender, EventArgs e)
        {
            //ejecutar siguiente proceso
            if (Cola.Any())
            {

                ProcesoActual = ProximoProceso();
                ProcesoActual.Ejecutar();

            }
            else
            {
                ProcesoActual = null;
                //this.Stop();
            }
        }
Пример #40
0
        private void LeerXML_archivoRespaldo(Proceso proceso, XmlNode xmlroot)
        {
            string nombre = xmlroot["data"].Attributes["nombre"].Value;
            string direccionLocal = xmlroot["data"].Attributes["direccionLocal"].Value;

            proceso.AgregarParametros_archivoRespaldo(nombre, direccionLocal);
        }
Пример #41
0
 private void EscribirXML_archivoBackup(StreamWriter sw, Proceso proceso)
 {
     sw.WriteLine("    <archivoBackup>");
     sw.WriteLine("      <data nombre=\"" + proceso.archivolocal.getNombre() + "\" direccionLocal=\"" + proceso.archivolocal.getDireccion() + "\" />");
     sw.WriteLine("    </archivoBackup>");
 }
Пример #42
0
        private void LeerXML_correoLog(Proceso proceso, XmlNode xmlroot)
        {
            string credentials_user = xmlroot["credentials_user"].Attributes["value"].Value;
            string credentials_pass = xmlroot["credentials_pass"].Attributes["value"].Value;
            string host = xmlroot["host"].Attributes["value"].Value;
            int port = Int32.TryParse(xmlroot["port"].Attributes["value"].Value, out port) ? port : 0;
            string asunto = xmlroot["asunto"].Attributes["value"].Value;
            int lapso = Int32.TryParse(xmlroot["lapsomin"].Attributes["value"].Value, out lapso) ? lapso : 0;

            XmlNodeList nodos = xmlroot["para"].ChildNodes;

            XmlNode nodoTemp;

            string body = "correo de log";

            IList<string> para = new List<string>();

            proceso.AgregarParametros_correoLog(credentials_user, credentials_pass, host, port, asunto, body, lapso);

            for (int i = 0; i < nodos.Count; i++)
            {
                nodoTemp = nodos.Item(i);
                if (nodoTemp.Name.Equals("correo"))
                {
                    para.Add(nodoTemp.Attributes["value"].Value);
                }

            }

            foreach (string item in para)
            {
                proceso.mensajeLog.correo.AgregarPara(item);
            }

            /////////////////////SMS////////////////
            try
            {
                proceso.mensajeLog.AgregarParamSMS(string.Empty, string.Empty, string.Empty, string.Empty);

            }
            catch (Exception exsms)
            {

            }
        }
Пример #43
0
        public DataTable Listar(Proceso proceso)
        {
            Conexion conexion = new Conexion(IdEmpresa);
            DataTable dataTable = new DataTable();
            string sql = null;
            sql = "select alias as id, alias as nombre from reportes where proceso  = '" + proceso.ToString() + "' order by alias";

            try
            {
                DataSet _dataSet = conexion.ExecuteReader(sql);
                dataTable = _dataSet.Tables[0].DefaultView.Table;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            finally
            {
                conexion.Desconectar();
            }
            return dataTable;
        }
Пример #44
0
        private void LeerXML_ftp(Proceso proceso, XmlNode xmlroot)
        {
            string Host = xmlroot["Host"].Attributes["value"].Value;
            string User = xmlroot["User"].Attributes["value"].Value;

            string Password = xmlroot["Password"].Attributes["value"].Value;
            string Dominio = xmlroot["Dominio"].Attributes["value"].Value;
            bool TLS = Boolean.TryParse(xmlroot["TLS"].Attributes["value"].Value, out TLS) ? TLS : false;
            bool SSL = Boolean.TryParse(xmlroot["SSL"].Attributes["value"].Value, out SSL) ? SSL : false;

            proceso.AgregarParametros_ftp(Host, User, Password, Dominio, TLS, SSL);
        }
Пример #45
0
 public ProcesoInterfaz(Proceso proceso)
 {
     InitializeComponent();
     this.proceso     = proceso;
     labelNombre.Text = proceso.NombrePrograma;
 }
Пример #46
0
        private Proceso ObtenerContenido(string NombreArchivo)
        {
            string xml = string.Empty;
            XmlNode xmlroot = null;

            Proceso proceso = new Proceso(0, string.Empty);

            int proceso_id;
            string proceso_nombre;

            try
            {
                xml = string.Join(string.Empty, File.ReadLines(SingletonSetting.Instance.directorioProcesos + @"\" + NombreArchivo, Encoding.UTF8));

                XmlDocument xmldoc = new XmlDocument();
                xmldoc.LoadXml(xml);

                XmlNodeList lista = xmldoc.GetElementsByTagName("root");
                xmlroot = lista[0];

                XmlNodeList nodoproceso = xmlroot.ChildNodes;

                proceso_id = Int32.TryParse(nodoproceso.Item(0).Attributes["id"].Value, out proceso_id) ? proceso_id : 0;
                proceso_nombre = nodoproceso.Item(0).Attributes["nombre"].Value;

                proceso = new Proceso(proceso_id, proceso_nombre);

                proceso.nombreArchivoBaseXML = NombreArchivo;

                XmlNodeList nodos = nodoproceso.Item(0).ChildNodes;

                if (nodos.Count > 0)
                {
                    XmlNode nodoTemp;

                    for (int i = 0; i < nodos.Count; i++)
                    {
                        nodoTemp = nodos.Item(i);

                        if (nodoTemp.Name.Equals("validar"))
                        {
                            LeerXML_validar(proceso, nodoTemp);
                        }
                        if (nodoTemp.Name.Equals("archivoBackup"))
                        {
                            LeerXML_archivoBackup(proceso, nodoTemp);
                        }
                        if (nodoTemp.Name.Equals("ftp"))
                        {
                            LeerXML_ftp(proceso, nodoTemp);
                        }
                        if (nodoTemp.Name.Equals("archivoRespaldo"))
                        {
                            LeerXML_archivoRespaldo(proceso, nodoTemp);
                        }
                        if (nodoTemp.Name.Equals("correoFallo"))
                        {
                            LeerXML_correoFallo(proceso, nodoTemp);
                        }
                        if (nodoTemp.Name.Equals("correoLog"))
                        {
                            LeerXML_correoLog(proceso, nodoTemp);
                        }
                        if (nodoTemp.Name.Equals("correoExito"))
                        {
                            LeerXML_correoExito(proceso, nodoTemp);
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                Log.Escribir(ex);
            }

            return proceso;
        }
Пример #47
0
        public async Task <IActionResult> InsertSelectOption(SelectDto selectDto)
        {
            var currentUser = HttpContext.User;

            if (currentUser.HasClaim(c => c.Type == "username"))
            {
                var     username = currentUser.Claims.FirstOrDefault(c => c.Type == "username").Value;
                Usuario user     = await _context.Usuarios.FirstOrDefaultAsync <Usuario>(u => u.Username == username);

                bool    notFound  = false;
                dynamic selectObj = null;
                switch (selectDto.SelectId)
                {
                case 1:
                    selectObj = new Actividad
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Actividades.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 2:
                    selectObj = new Area
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Areas.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 3:
                    selectObj = new Casualidad
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Casualidades.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 4:
                    selectObj = new CausaBasica
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.CausaBasicas.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 5:
                    selectObj = new CausaInmediata
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.CausaInmediatas.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 6:
                    selectObj = new Clasificacion
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Clasificaciones.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 7:
                    selectObj = new Comportamiento
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Comportamientos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 8:
                    selectObj = new Efecto
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Efectos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 9:
                    selectObj = new FactorRiesgo
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.FactorRiesgos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 10:
                    selectObj = new Genero
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Generos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 11:
                    selectObj = new IndicadorRiesgo
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.IndicadorRiesgos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 12:
                    selectObj = new Jornada
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Jornadas.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 13:
                    selectObj = new Observado
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Observados.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 14:
                    selectObj = new ParteCuerpo
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.ParteCuerpos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 15:
                    selectObj = new Proceso
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Procesos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 16:
                    selectObj = new Riesgo
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Riesgos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 17:
                    selectObj = new TipoComportamiento
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.TipoComportamientos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 18:
                    selectObj = new TipoObservado
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.TipoObservados.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 19:
                    selectObj = new Turno
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Turnos.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 20:
                    selectObj = new Categoria
                    {
                        Nombre = selectDto.Nombre
                    };
                    await _context.Categorias.AddAsync(selectObj);

                    await _context.SaveChangesAsync();

                    break;

                case 21:
                    if (selectDto.ParentOptionId != null)
                    {
                        selectObj = new Subcategoria
                        {
                            Nombre      = selectDto.Nombre,
                            CategoriaId = selectDto.ParentOptionId ?? 0
                        };
                        await _context.Subcategorias.AddAsync(selectObj);

                        await _context.SaveChangesAsync();

                        break;
                    }
                    else
                    {
                        notFound = true;
                        break;
                    }


                default:
                    notFound = true;
                    break;
                }
                if (notFound)
                {
                    return(StatusCode(400));
                }
                Bitacora bitacora = new Bitacora
                {
                    Fecha               = DateTime.Now,
                    UsuarioId           = user.Id,
                    DescripcionBitacora = $"Creó nueva opción de formulario {selectObj.Nombre}"
                };
                await _context.Bitacora.AddAsync(bitacora);

                await _context.SaveChangesAsync();

                return(Ok(selectObj));
            }
            return(Unauthorized());
        }
 private void Informar(Label label, String mensaje, Proceso proceso)
 {
     label.Text = mensaje;
     switch (proceso)
     {
         case Proceso.Correcto:
             label.ForeColor = System.Drawing.Color.Green;
             break;
         case Proceso.Error:
             label.ForeColor = System.Drawing.Color.Red;
             break;
     }
 }
        private void Hilo_ejecutarProceso_RUN()
        {
            while (true)
            {
                if (killThread)
                {
                    break;
                }

                int milliseconds = 2000;
                System.Threading.Thread.Sleep(milliseconds);

                if (Cola.Any())
                {
                    ProcesoActual = ProximoProceso();
                    Log.Escribir("iniciando proceso: " + ProcesoActual.nombre);

                    ProcesoActual.Ejecutar();

                    Log.Escribir("Termino de proceso: " + ProcesoActual.nombre);
                }
                else
                {
                    if (ProcesoActual != null)
                    {
                        ProcesoActual.CerrarProcesoActual();
                    }
                    ProcesoActual = null;
                }

            }
        }
Пример #50
0
 public bool GrabarProceso(Proceso proceso)
 {
     return(gb.GrabarProceso(proceso));
 }
Пример #51
0
        public async Task <Proceso> ConsultarProcesoPorGuid(Guid guidProceso, UsuarioDTO usuarioDTO)
        {
            Proceso proceso = await _procesoRepository.ConsultarProcesoPorGuid(guidProceso, usuarioDTO);

            return(proceso);
        }
Пример #52
0
        private void CargarArchivo( string ruta)
        {
            StreamReader lr = new StreamReader(ruta);

            int numProc = Convert.ToInt32(lr.ReadLine());
            lr.Close();

            Proceso[] VectorProc = new Proceso[numProc];
            for (int i = 0; i < numProc; i++)
                VectorProc[i] = new Proceso();

            Planificador.leerArchivo(VectorProc,ruta);

            foreach( Proceso p in VectorProc)
            {
                ListViewItem it = new ListViewItem(p.GSnombre);
                it.SubItems.Add(p.Prioridad.ToString());
                it.SubItems.Add(p.Vejes.ToString());
                it.SubItems.Add(p.GSTiempoLLegada.ToString());
                it.SubItems.Add(p.GSduracion.ToString());
                listView2.Items.Add(it);
                listView2.Refresh();

            }
        }
Пример #53
0
        public string ToString()
        {
            string cadena = " Pk_Id_Inspecciones: " + Pk_Id_Inspecciones +
                            " Id_Inspeccion: " + Id_Inspeccion +
                            " Sede: " + ((Sede == null) ? Fk_Id_Sede.ToString() : Sede.ToString()) +
                            " Proceso: " + ((Proceso == null) ? Fk_Id_Proceso.ToString() : Proceso.ToString()) +
                            " Fecha_Realizacion: " + Fecha_Realizacion +
                            " PlaneacionInspeccion: " + ((PlaneacionInspeccion == null) ? Fk_Id_PlaneacionInspeccion.ToString() : PlaneacionInspeccion.ToString()) +
                            " Descripcion_Tipo_Inspeccion: " + Descripcion_Tipo_Inspeccion +
                            " Estado_Inspeccion: " + Estado_Inspeccion +
                            " Fk_IdEmpresa: " + Fk_IdEmpresa +
                            " Area_Lugar: " + Area_Lugar +
                            " Hora: " + Hora +
                            " Responsable_Lugar: " + Responsable_Lugar;

            if (ConfiguracionporInspeccion != null)
            {
                foreach (ConfiguracionporInspeccion configInspe in ConfiguracionporInspeccion)
                {
                    cadena = cadena + " ConfiguracionporInspeccion:{ " + configInspe.ToString() + "}";
                }
            }
            if (AsistentesporInspeccion != null)
            {
                foreach (AsistentesporInspeccion asisInpe in AsistentesporInspeccion)
                {
                    cadena = cadena + " AsistentesporInspeccion:{ " + asisInpe.ToString() + "}";
                }
            }
            if (PlanAccionporInspeccion != null)
            {
                foreach (PlanAccionporInspeccion planInpe in PlanAccionporInspeccion)
                {
                    cadena = cadena + " PlanAccionporInspeccion:{ " + planInpe.ToString() + "}";
                }
            }
            if (EHMInspeccioness != null)
            {
                foreach (EHMInspecciones EHMInspe in EHMInspeccioness)
                {
                    cadena = cadena + " EHMInspecciones:{ " + EHMInspe.ToString() + "}";
                }
            }
            return(cadena);
        }
Пример #54
0
        // mostrar dentro del listView
        private void display( Proceso Procesado)
        {
            ListViewItem it = new ListViewItem(Procesado.GSnombre);
            it.SubItems.Add(Procesado.GSTiempoLLegada.ToString());
            it.SubItems.Add(Procesado.GSduracion.ToString());

            it.SubItems.Add(Procesado.Prioridad.ToString());
            it.SubItems.Add(Procesado.Vejes.ToString());

            it.SubItems.Add(Procesado.Tinicio.ToString());
            it.SubItems.Add(Procesado.Tfinal.ToString());
            it.SubItems.Add(Procesado.Tretorno.ToString());
            it.SubItems.Add(Procesado.tEspera.ToString());

            listView1.Items.Add(it);
            listView1.Refresh();
        }
Пример #55
0
        public Factura()
        {
            InitializeComponent();
            Modificar          = "G";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);
            this.ControlBox    = false;
            this.Text          = "FACTURAS";
            formFactura        = this;
            objMonedaDao       = new MonedaDAO();
            objMonedaDao.tipoCambio();
            objEjercicio   = new Ejercicio();
            objTipoPagoDao = new TipoPagoDAO();
            objDocumento   = new DocumentoDAO();
            objProceso     = new Proceso();
            comboMoneda();
            comboPago();
            cmbejercicio();
            chk_Detraccion.CheckedChanged += Chk_Detraccion_CheckedChanged;
            cmb_Pago.SelectedIndexChanged += Cmb_Pago_SelectedIndexChanged;
            gridParams();
            txt_Porcentaje.TextChanged += Txt_Porcentaje_TextChanged;
            txt_Porcentaje.Text         = "0";
            if (ListaFactura.operacionFactura == "V")
            {
                if (ListaFactura.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }
                else if (ListaFactura.objDocumentoCab.EstadoSunat == 1)
                {
                    btn_Modificar.Visible = true;
                }
                habilitarBotones(false, false);
                habilitarCampos(false);
                txt_Guia.Enabled       = false;
                txt_OT.Enabled         = false;
                txt_Pedido.Enabled     = false;
                txt_GlosaCab.Enabled   = false;
                btn_BuscarOT.Enabled   = false;
                btn_Limpiar.Enabled    = false;
                btn_SaveData.Enabled   = false;
                btn_Buscar.Enabled     = false;
                dpck_Fechavcto.Enabled = false;
                dpick_Fecha.Enabled    = false;
                cmb_Moneda.Enabled     = false;
                cmb_Pago.Enabled       = false;

                if (ListaFactura.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    lbl_Moneda.Text = "$";
                }
                else
                {
                    lbl_Moneda.Text = "S/";
                }
                objDocumentoDet = new DocumentoDet();

                if (objDocumentoDet.DocumentoProdUM == "NIU")
                {
                    txt_umcod.Text = "039";
                }
                else
                {
                    txt_umcod.Text = "040";
                }

                txt_Cliente.Text         = ListaFactura.objDocumentoCab.DocumentoCabCliente;
                txt_Ruc.Text             = ListaFactura.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_Serie.Text           = ListaFactura.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text          = ListaFactura.objDocumentoCab.DocumentoCabNro;
                txt_GlosaCab.Text        = ListaFactura.objDocumentoCab.DocumentoCabGlosa;
                txt_Direccion.Text       = ListaFactura.objDocumentoCab.DocumentoCabClienteDireccion;
                cmb_Moneda.SelectedValue = ListaFactura.objDocumentoCab.DocumentoCabTipoMoneda;
                objListDocumentoDet      = objDocumento.listarDetalle(ListaFactura.numeroDocumento, ListaFactura.numeroSerie, Ventas.UNIDADNEGOCIO);
                dpick_Fecha.Value        = ListaFactura.objDocumentoCab.DocumentoCabFecha;
                tipoCambio(dpick_Fecha.Value.ToShortDateString());
                cmb_Pago.SelectedValue = ListaFactura.objDocumentoCab.DocumentoCabTipoPago;
                txt_Detraccion.Text    = ListaFactura.objDocumentoCab.DocumentoCabDetraccion.ToString();
                txt_Porcentaje.Text    = ListaFactura.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Guia.Text          = ListaFactura.objDocumentoCab.DocumentoCabGuia;
                txt_intercorp.Text     = ListaFactura.objDocumentoCab.Intercorp;
                txt_Pedido.Text        = ListaFactura.objDocumentoCab.DocumentoCabOrdenCompra;
                txt_codcliente.Text    = ListaFactura.objDocumentoCab.DocumentoCabClienteCod;
                grd_Detalle.DataSource = objListDocumentoDet;
                grd_Detalle.Refresh();
                llenarSumatorias();
            }
            else
            {
                if (Ventas.UNIDADNEGOCIO == "01")
                {
                    txt_Serie.Text = "F001";
                }
                else
                {
                    txt_Serie.Text = "F005";
                }

                txt_Numero.Text      = objDocumento.correlativoFactura("01", Ventas.UNIDADNEGOCIO, txt_Serie.Text);
                dpck_Fechavcto.Value = DateTime.Now.AddMonths(1);
                habilitarCampos(false);
                tipoCambio(DateTime.Now.ToShortDateString());
                objDocumentoCab     = new DocumentoCab();
                objListDocumentoDet = new List <DocumentoDet>();
                ContadorItem        = 1;
            }

            rb_OT.Select();



            dpick_Fecha.TextChanged += Dpick_Fecha_TextChanged;

            txt_PrecioUnitario.TextChanged += Txt_PrecioUnitario_TextChanged;
            txt_Cantidad.TextChanged       += Txt_Cantidad_TextChanged;
            txt_Percepcion.Text             = "0";
            grd_Detalle.CellClick          += Grd_Detalle_CellClick;

            cmb_Moneda.SelectedValueChanged += Cmb_Moneda_SelectedValueChanged;
        }
Пример #56
0
        private void GraficarProceso(Proceso ProcesoListo, int Yvalue, int inicio)
        {
            // crear series
            Series serie = gant.Series.Add(ProcesoListo.GSnombre);
            serie.ChartType = SeriesChartType.Point;

            for (int i = inicio ; i <= ProcesoListo.Tfinal ; i++)
                serie.Points.AddXY(i, Yvalue);
        }
Пример #57
0
 public ActionResult Edit(int id)
 {
     if (id == -1)
     {
         var mol      = new ProcesoAddViewModel();
         var proces   = Negocioservice.GetProcesos();
         var usuarios = Negocioservice.GetUsuarios();
         mol.IdUsuario    = -1;
         mol.nombre       = string.Empty;
         mol.Idporceso    = -1;
         mol.procesopadre = -1;
         var ProcesoList = new List <SelectListItem>();
         var UsuarioList = new List <SelectListItem>();
         ProcesoList.Add(new SelectListItem {
             Value = "-1", Text = "--Seleccione un proceso--", Selected = true
         });
         UsuarioList.Add(new SelectListItem {
             Value = "-1", Text = "--Seleccione un Usuario--", Selected = true
         });
         foreach (var il in proces)
         {
             ProcesoList.Add(new SelectListItem {
                 Value = il.Idporceso.ToString(), Text = il.nombre
             });
         }
         foreach (var il in usuarios)
         {
             var name = il.Nombre + " " + il.Apellido + "-" + il.Cedula;
             UsuarioList.Add(new SelectListItem {
                 Value = il.IdUsuario.ToString(), Text = name
             });
         }
         mol.procesos = ProcesoList;
         mol.usuarios = UsuarioList;
         return(View(mol));
     }
     else
     {
         Proceso model    = Negocioservice.GetProceso(id);
         var     mol      = new ProcesoAddViewModel();
         var     proces   = Negocioservice.GetProcesos();
         var     usuarios = Negocioservice.GetUsuarios();
         mol.IdUsuario    = model.IdUsuario;
         mol.nombre       = model.nombre;
         mol.Idporceso    = model.Idporceso;
         mol.procesopadre = model.procesopadre;
         var ProcesoList = new List <SelectListItem>();
         var UsuarioList = new List <SelectListItem>();
         ProcesoList.Add(new SelectListItem {
             Value = "-1", Text = "--Seleccione un proceso--", Selected = true
         });
         UsuarioList.Add(new SelectListItem {
             Value = "-1", Text = "--Seleccione un Usuario--", Selected = true
         });
         foreach (var il in proces)
         {
             if (il.Idporceso == mol.procesopadre)
             {
                 ProcesoList.Add(new SelectListItem {
                     Value = il.Idporceso.ToString(), Text = il.nombre, Selected = true
                 });
             }
             else if (il.Idporceso != mol.Idporceso)
             {
                 ProcesoList.Add(new SelectListItem {
                     Value = il.Idporceso.ToString(), Text = il.nombre
                 });
             }
         }
         foreach (var il in usuarios)
         {
             var name = il.Nombre + " " + il.Apellido + "-" + il.Cedula;
             if (il.IdUsuario == mol.IdUsuario)
             {
                 UsuarioList.Add(new SelectListItem {
                     Value = il.IdUsuario.ToString(), Text = name, Selected = true
                 });
             }
             else
             {
                 UsuarioList.Add(new SelectListItem {
                     Value = il.IdUsuario.ToString(), Text = name
                 });
             }
         }
         mol.procesos = ProcesoList;
         mol.usuarios = UsuarioList;
         return(View(mol));
     }
 }
    private void Informar(Panel panel_fondo, System.Web.UI.WebControls.Image imagen_mensaje, Panel panel_mensaje, Label label_mensaje, String mensaje, Proceso proceso)
    {
        panel_fondo.Style.Add("display", "block");
        panel_mensaje.Style.Add("display", "block");

        label_mensaje.Font.Bold = true;

        switch (proceso)
        {
            case Proceso.Correcto:
                label_mensaje.ForeColor = System.Drawing.Color.Green;
                imagen_mensaje.ImageUrl = "~/imagenes/plantilla/ok_popup.png";
                break;
            case Proceso.Error:
                label_mensaje.ForeColor = System.Drawing.Color.Red;
                imagen_mensaje.ImageUrl = "~/imagenes/plantilla/error_popup.png";
                break;
            case Proceso.Advertencia:
                label_mensaje.ForeColor = System.Drawing.Color.Orange;
                imagen_mensaje.ImageUrl = "~/imagenes/plantilla/advertencia_popup.png";
                break;
        }

        panel_fondo.Visible = true;
        panel_mensaje.Visible = true;

        label_mensaje.Text = mensaje;
    }
Пример #59
0
        public static string SolicitudPdf(Proceso proceso)
        {
            //ModeloSolicitud modelo = obtenerModelo();
            String pagina = "<!DOCTYPE html><html><head><title></title>";

            pagina += "</head><body> <div id='Solicitud'><DIV ALIGN='center'><img src='https://i.imgur.com/SS6BFCs.png' width='10%'  border=0></DIV><div ALIGN='right'><P> " + proceso.Solicitud.FechaPdf + "</P></div><DIV ALIGN='left'>";

            if (proceso.Organizacion != null)
            {
                if (proceso.Direccion.Sexo.Equals("Femenino"))
                {
                    pagina += "<P style='line-height:1px'><B>Sra. " + proceso.Direccion.Nombre + "</B></P>";
                }
                else
                {
                    pagina += "<P style='line-height:1px'><B>Sr. " + proceso.Direccion.Nombre + "</B></P>";
                }
                pagina += "<P style='line-height:3px'><I>" + proceso.Direccion.Cargo + "</I></P>";
                pagina += "<P style='line-height:3px'><I>" + proceso.Direccion.Institucion.Nombre + "</I></P>";
            }

            pagina += "<P style='line-height:1px'><I>Universidad de Talca</I></P><P style='line-height:1px'><B><U>Presente.</U></B></P></DIV><DIV style='text-align:justify'><P>De nuestra consideración:</P>";

            if (proceso.Organizacion.TipoOE.Nombre.Equals("CAA"))
            {
                pagina += "<P>Junto con saludar cordialmente, me dirijo a usted como " + proceso.Responsable.Rol.Nombre + " del centro de alumnos de  " + proceso.Responsable.Organizacion.Institucion.Nombre + ", para solicitarle apoyo económico con el fin de realizar la actividad estudiantil que se indica a continuación:</P>";
            }
            else
            {
                pagina += "<P>Junto con saludar cordialmente, me dirijo a usted como " + proceso.Responsable.Rol.Nombre + " de " + proceso.Organizacion.Nombre + ", para solicitarle apoyo económico con el fin de realizar la actividad estudiantil que se indica a continuación:</P>";
            }

            pagina += "<ul><li><B>Nombre de la actividad: </B>" + proceso.Solicitud.NombreEvento + ".</li>";
            pagina += "<li><B>Periodo: </B>" + proceso.Solicitud.FechaEvento + ".</li>";
            pagina += "<li><B>Ubicación: </B>" + proceso.Solicitud.LugarEvento + ".</li></ul>";

            NumberFormatInfo FormatoMoneda = new CultureInfo("arn-CL", false).NumberFormat;

            FormatoMoneda.CurrencyPositivePattern = 0;
            String monto = proceso.Solicitud.Monto.ToString("C0", FormatoMoneda);


            if (proceso.Solicitud.Participantes != null)
            {
                String montoPorPersona = proceso.Solicitud.MontoPorPersona.ToString("C0", FormatoMoneda);
                pagina += "<P>Para llevar a cabo esta actividad se solicita un monto total de " + monto + " sujeto a rendición y así poder otorgar una ayuda de ";
                pagina += montoPorPersona + " a cada estudiante para solventar parcialmente sus gastos de " + proceso.Solicitud.CategoriasConcatenadas + ".</P>";


                pagina += "<P>Los alumnos que participarán en la actividad son:</P>";

                pagina += "<table><thead><tr class='table100-head'><th>Nombre</th><th>Run</th></tr></thead>";
                pagina += "<tbody>";
                foreach (var item in proceso.Solicitud.Participantes)
                {
                    pagina += "<tr>";
                    pagina += "<td>" + item.Nombre + "</td>";
                    pagina += "<td>" + FormatearRut(item.RUN) + "</td>";
                    pagina += "</tr>";
                }
                pagina += "</tbody></table>";
            }
            else
            {
                pagina += "<P>Se solicita un monto total de " + monto + " sujeto a rendición para solventar parcialmente los gastos de " + proceso.Solicitud.CategoriasConcatenadas + ".</P>";
            }


            if (proceso.Organizacion.TipoOE.Nombre.Equals("CAA"))
            {
                pagina += "<P>Dicho monto quedará bajo la responsabilidad de " + proceso.Responsable.Nombre + ", RUT " + FormatearRut(proceso.Responsable.RUN);
                pagina += ", matrícula " + proceso.Responsable.Matricula + ", en su calidad de " + proceso.Responsable.Rol.Nombre;
                pagina += " del Centro de Alumnos de " + proceso.Responsable.Organizacion.Institucion.Nombre + " de la Universidad de Talca. </P>";
            }
            else
            {
                pagina += "<P>Dicho monto quedará bajo la responsabilidad de " + proceso.Responsable.Nombre + ", RUT " + FormatearRut(proceso.Responsable.RUN);
                pagina += ", matrícula " + proceso.Responsable.Matricula + ", en su calidad de  " + proceso.Responsable.Rol.Nombre + " de ";
                pagina += proceso.Organizacion.Nombre + " de la Universidad de Talca.</P>";
            }

            pagina += "<P>Esperando una buena acogida y una pronta respuesta de esta solicitud, se despide atentamente de usted.</P>";
            pagina += "<DIV ALIGN='center' style='padding-top:80px;'><P style='line-height:3px'><B>" + proceso.Responsable.Nombre + "</B></P>";
            pagina += "<P style='line-height:3px'>" + proceso.Responsable.Rol.Nombre + "</P>";

            if (proceso.Responsable.Organizacion.TipoOE.Nombre.Equals("CAA"))
            {
                pagina += "<P style='line-height:3px'>CAA " + proceso.Responsable.Organizacion.Institucion.Nombre + "</P>";
            }
            else
            {
                pagina += "<P style='line-height:3px'>" + proceso.Organizacion.Nombre + "</P>";
            }

            pagina += "<P style='line-height:3px'>Universidad de Talca</P></DIV></body></html> ";

            return(pagina);
        }