public XmlDocument Post(datos Datos)
        {
            try
            {
                string UsuarioDesencripta = Seguridad.DesEncriptar(Datos.Usuario);

                DocumentoEntrada entrada = new DocumentoEntrada();
                entrada.Usuario     = UsuarioDesencripta;
                entrada.Origen      = "Programa CGE";
                entrada.Transaccion = 120760;
                entrada.Operacion   = 6;

                entrada.agregaElemento("RmReqId", Datos.RmReqId);


                DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

                if (respuesta.Resultado == "1")
                {
                    return(respuesta.Documento);
                }
                else
                {
                    var errores = respuesta.Errores;

                    return(respuesta.Documento);
                }
            }
            catch (System.Exception)
            {
                return(null);
            }
        }
Example #2
0
        private void cmdNuevo_Click(object sender, EventArgs e)
        {
            if (txtCamion.Text != "")
            {
                datos objDatos = new datos();
                objDatos.Conectar();
                objDatos.Consulta_llenar_datos("consultar_salida_camion " + this.txtCamion.Text + "");

                Reportes.Salida.rptSalidaCamiones rp = new Reportes.Salida.rptSalidaCamiones();
                rp.SetDataSource(objDatos.ds.Tables[0]);
                crystalReportViewer1.ReportSource = rp;

                crystalReportViewer1.ShowCloseButton          = false;
                crystalReportViewer1.ShowCopyButton           = false;
                crystalReportViewer1.ShowGotoPageButton       = false;
                crystalReportViewer1.ShowLogo                 = false;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.DisplayStatusBar         = false;

                crystalReportViewer1.RefreshReport();

                objDatos.Desconectar();
            }
            else
            {
                MessageBox.Show("Debe seleccionar un camion");
            }
        }
        public IActionResult Documentos([FromBody] dynamic value)
        {
            try
            {
                int idObjeto                = value.idObjeto != null ? (int)value.idObjeto : default(int);
                int idTipoObjeto            = value.idTipoObjeto != null ? (int)value.idTipoObjeto : default(int);
                List <Documento> documentos = DocumentosAdjuntosDAO.getDocumentos(idObjeto, idTipoObjeto);

                List <datos> datos_ = new List <datos>();
                foreach (Documento documento in documentos)
                {
                    datos dato = new datos();
                    dato.id        = documento.id;
                    dato.nombre    = documento.nombre;
                    dato.extension = documento.extension;
                    datos_.Add(dato);
                }

                return(Ok(new { success = true, documentos = datos_ }));
            }
            catch (Exception e)
            {
                CLogger.write("2", "DocumentoAdjuntoController.class", e);
                return(BadRequest(500));
            }
        }
Example #4
0
        public datos resulta(int para)
        {
            datos res = new datos();

            if (para == 1)
            {
                res.id     = 1;
                res.nombre = "Marcelo";
            }
            else
            {
                res.id     = 2;
                res.nombre = "Rodrigo";
            }


            //var consult = new [{ "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"1","EMPRESA":"1","IMPORTELIQUIDADO":"3812.51","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"P.B.U - PRESTACION BASICA UNIVERSAL","MARCADEBCRED":"C","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"}];
            //               new { "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"1","EMPRESA":"2","IMPORTELIQUIDADO":"3141.07","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"P.C   - PRESTACION COMPENSATORIA","MARCADEBCRED":"C","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"1","EMPRESA":"3","IMPORTELIQUIDADO":"284.86","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"P.A.P - PRESTACION ADIC.P/PERMANENC","MARCADEBCRED":"C","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"2","EMPRESA":"1","IMPORTELIQUIDADO":"5764.22","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"PRESTACION ANUAL COMPLEMENTARIA","MARCADEBCRED":"C","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"88","EMPRESA":"0","IMPORTELIQUIDADO":"4290","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"COMPLEMENTO AL MINIMO-DECRETO 525/9","MARCADEBCRED":"C","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"318","EMPRESA":"8","IMPORTELIQUIDADO":"345.85","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"OBRA SOCIAL 3% SOBRE HABERES","MARCADEBCRED":"D","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43497","FECHALIQUIDACION":"43497","CONCEPTO":"319","EMPRESA":"11","IMPORTELIQUIDADO":"172.93","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"DESCUENTO PRESTACION ANUAL COMPLEME","MARCADEBCRED":"D","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43525","FECHALIQUIDACION":"43525","CONCEPTO":"1","EMPRESA":"1","IMPORTELIQUIDADO":"25","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"P.B.U - PRESTACION BASICA UNIVERSAL","MARCADEBCRED":"C","CODIGOTIPOLIQ":"1","DESCTLIQ":"MENSUAL NORMAL","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"},
            //                { "BENEFICIO":"14019033300","FECHAEMISION":"43525","FECHALIQUIDACION":"43525","CONCEPTO":"1","EMPRESA":"1","IMPORTELIQUIDADO":"25","IMPORTEDEUDATOTAL":"NULL","CANTIDADCUOTAS":"NULL","DESCRIPCONCEPTO":"P.B.U - PRESTACION BASICA UNIVERSAL","MARCADEBCRED":"C","CODIGOTIPOLIQ":"2","DESCTLIQ":"COMPLEMENTARIA 1","ESTADO":"9999","DESCRESTADO":"LIQUIDACION NORMAL"}


            return(res);
        }
Example #5
0
        public ActionResult Editar(datos d)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    using (CrudEntities1 bd = new CrudEntities1())
                    {
                        var datosP = bd.datos.Where(x => x.id == d.id).FirstOrDefault();

                        if (datosP != null)
                        {
                            datosP.nombre           = d.nombre;
                            datosP.correo           = d.correo;
                            datosP.fecha_nacimiento = d.fecha_nacimiento;
                            datosP.id = d.id;

                            bd.SaveChanges();
                        }
                    }

                    return(RedirectToAction("/"));
                }

                return(View());
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Example #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string a = "";

            Console.WriteLine("Pros es: " + pros);
            int i = 1;

            listBox1.Items.Clear();
            lista.Clear();
            List <datos> d = new List <datos>();

            foreach (HtmlElement et in web.Document.GetElementsByTagName("a"))
            {
                if (et.GetAttribute("classname").Contains("gs-image gs-image-scalable")) // anterior gs-title
                {
                    Console.WriteLine("Enlaze " + i + " ? " + et.GetAttribute("href"));
                    datos n = new datos();
                    n.name = et.GetAttribute("href").Split('/')[et.GetAttribute("href").Split('/').Length - 2];
                    n.url  = et.GetAttribute("href");
                    a      = n.name;
                    d.Add(n);
                    i++;
                }
            }
            foreach (var z in d)
            {
                listBox1.Items.Add(z.name);
                lista.Add(z);
            }
        }
Example #7
0
        public static string GeneraRequisicion(datos Datos)
        {
            string UsuarioDesencripta = Seguridad.DesEncriptar(Datos.Usuario);

            DocumentoEntrada entrada = new DocumentoEntrada();

            entrada.Usuario     = UsuarioDesencripta;
            entrada.Origen      = "Programa CGE"; //Datos.Origen;
            entrada.Transaccion = 120760;
            entrada.Operacion   = 9;

            entrada.agregaElemento("RmReqId", Datos.RmReqId);

            DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

            if (respuesta.Resultado == "1")
            {
                //var resultado = "Requisicion Generadacorrectamente";

                return("");
            }
            else
            {
                var errores = respuesta;

                return("");
            }
        }
Example #8
0
        public XmlDocument Post(datos Datos)
        {
            string UsuarioDesencripta = Seguridad.DesEncriptar(Datos.Usuario);

            DocumentoEntrada entrada = new DocumentoEntrada
            {
                Usuario     = UsuarioDesencripta,
                Origen      = "Programa CGE", //Datos.Origen;
                Transaccion = 120760,
                Operacion   = 10              //autorizar requisiciones
            };

            entrada.agregaElemento("RmReqId", Datos.RmReqId);
            entrada.agregaElemento("RmReqEstatus", Datos.RmReqEstatus);
            DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

            if (respuesta.Resultado == "1")
            {
                return(respuesta.Documento);
            }
            else
            {
                return(respuesta.Documento);
            }
        }
        public string Post(datos Datos)
        {
            string UsuarioDesencripta = Seguridad.DesEncriptar(Datos.Usuario);

            DocumentoEntrada entrada = new DocumentoEntrada();

            entrada.Usuario     = UsuarioDesencripta;
            entrada.Origen      = "Programa CGE"; //Datos.Origen;
            entrada.Transaccion = 120762;
            entrada.Operacion   = 4;

            entrada.agregaElemento("RmRdeRequisicion", Datos.RmRdeRequisicion);
            entrada.agregaElemento("RmRdeId", Datos.RmRdeId);

            DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

            if (respuesta.Resultado == "1")
            {
                return("OK");
            }
            else
            {
                var errores = respuesta.Errores;

                return(null);
            }
        }
Example #10
0
        private void guardarDetalleFactura()
        {
            datos objDatos = new datos();

            objDatos.Conectar();
            string sql = "select precio,cantidad,codigo_art,descuento,cantidad*precio as 'importe' from facturatemporal";

            objDatos.Consulta_llenar_datos(sql);

            //Buscar cantidad de articulos
            obDatos.consultar("select count(distinct codigo_art) from ", "facturatemporal");
            int cantArticulos = Convert.ToInt32(obDatos.ds.Tables["facturatemporal"].Rows[0][0].ToString());

            for (int n = 0; n < cantArticulos; n++)
            {
                double precio      = Convert.ToDouble(objDatos.ds.Tables[0].Rows[n][0].ToString());
                int    cantidad    = Convert.ToInt32(objDatos.ds.Tables[0].Rows[n][1].ToString());
                int    codArticulo = Convert.ToInt32(objDatos.ds.Tables[0].Rows[n][2].ToString());
                int    descuento   = Convert.ToInt32(objDatos.ds.Tables[0].Rows[n][3].ToString());
                double importe     = Convert.ToDouble(objDatos.ds.Tables[0].Rows[n][4].ToString());
                obDatos.consultar("SELECT COUNT(id_detall) from ", "detalle_facturas");
                int idDetall = Convert.ToInt32(obDatos.ds.Tables["detalle_facturas"].Rows[0][0].ToString()) + 1;

                obDatos.Consulta_llenar_datos("exec inserta_detalles_facturas " + idDetall + "," + this.txtNumeroFactura.Text + "," + precio + "," + cantidad + "," + codArticulo + "," + descuento + "," + importe + "");
                objDatos.Desconectar();
            }
        }
Example #11
0
    public static string cargarDatosPrincipales(string id_usuario)
    {
        string json = "";

        Tab_usuario       usuarios       = new Tab_usuario();
        MetodosTabUsuario metodosUsuario = new MetodosTabUsuario();
        DataSet           ds             = new DataSet();

        usuarios.Id_usuario = Convert.ToInt32(id_usuario);
        ds = metodosUsuario.obtenerDatosEspecificos(usuarios, 2);

        if (ds != null)
        {
            foreach (DataRow item in ds.Tables[0].Rows)
            {
                datos dt = new datos
                {
                    rut             = item["Rut"].ToString(),
                    nombre          = item["nombre"].ToString(),
                    email           = item["email"].ToString(),
                    apellidoPaterno = item["apellidoPaterno"].ToString(),
                    apellidoMaterno = item["apellidoMaterno"].ToString(),
                    direccion       = item["direccion"].ToString(),
                    fono            = item["fono"].ToString()
                };
                json = JsonConvert.SerializeObject(dt);
            }
        }
        return(json);
    }
Example #12
0
        private void descontarInventario()
        {
            try
            {
                datos objDatos1 = new datos();
                //Buscar cantidad de articulos = 3
                obDatos.consultar("select count(distinct codigo_art) from ", "facturatemporal");
                int cantArticulos = Convert.ToInt32(obDatos.ds.Tables["facturatemporal"].Rows[0][0].ToString());


                //Buscar los codigos de los articulos entrados
                string sql3 = "select distinct codigo_art,cantidad from facturatemporal";
                objDatos1.Consulta_llenar_datos(sql3);

                for (int n = 0; n < cantArticulos; n++)
                {
                    string sql2 = "";
                    int    existencia = 0, existencia_actual = 0, cantidad = Convert.ToInt32(objDatos1.ds.Tables[0].Rows[n][1].ToString()), codArt = Convert.ToInt32(objDatos1.ds.Tables[0].Rows[n][0].ToString());
                    sql2 = "select SUM(existencia) from inventario where codigo_art = " + objDatos1.ds.Tables[0].Rows[n][0].ToString();
                    obDatos.Consulta_llenar_datos(sql2);
                    existencia_actual = Convert.ToInt32(obDatos.ds.Tables[0].Rows[0][0].ToString());
                    existencia        = existencia_actual - cantidad;

                    obDatos.Consulta_llenar_datos("exec inserta_actualiza_inventario 1," + codArt.ToString() + "," + existencia.ToString() + ",1");
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("No existe suficiente cantidad del articulo");
            }
        }
Example #13
0
        public List <ObtieneInformeResult> PostObtieneInformes(datos Datos)
        {
            //string UsuarioDesencripta = Seguridad.DesEncriptar(Datos.ugasto);

            SqlCommand comando = new SqlCommand("selectDatosAdicionales");

            comando.CommandType = CommandType.StoredProcedure;

            //Declaracion de parametros
            comando.Parameters.Add("@id", SqlDbType.Int);
            comando.Parameters.Add("@idinforme", SqlDbType.Int);
            comando.Parameters.Add("@idproyecto", SqlDbType.Int);

            //Asignacion de valores a parametros
            comando.Parameters["@id"].Value         = Datos.id;
            comando.Parameters["@idinforme"].Value  = Datos.idinforme;
            comando.Parameters["@idproyecto"].Value = Datos.idproyecto;

            comando.Connection     = new SqlConnection(VariablesGlobales.CadenaConexion);
            comando.CommandTimeout = 0;
            comando.Connection.Open();
            //DA.SelectCommand = comando;
            //comando.ExecuteNonQuery();

            DataTable      DT = new DataTable();
            SqlDataAdapter DA = new SqlDataAdapter(comando);

            comando.Connection.Close();

            DA.Fill(DT);

            //ObtieneInformeResult items;

            List <ObtieneInformeResult> lista = new List <ObtieneInformeResult>();

            if (DT.Rows.Count > 0)
            {
                // DataRow row = DT.Rows[0];
                foreach (DataRow row in DT.Rows)
                {
                    ObtieneInformeResult ent = new ObtieneInformeResult
                    {
                        g_rfc         = Convert.ToString(row["g_rfc"]),
                        g_contacto    = Convert.ToString(row["g_contacto"]),
                        g_telefono    = Convert.ToString(row["g_telefono"]),
                        g_correo      = Convert.ToString(row["g_correo"]),
                        ncomensales   = Convert.ToInt32(row["g_ncomensales"]),
                        nmbcomensales = Convert.ToString(row["g_nmbcomensales"])
                    };

                    lista.Add(ent);
                }

                return(lista);
            }
            else
            {
                return(null);
            }
        }
Example #14
0
        public List <datos> GetOrdenes(string Orden)
        {
            var persons = new List <datos>();

            IHojaRutaRepartidor hojaRutaRepartidor = HojaRutaRepartidorFactory.GetHojaRutaRepartidor();
            //hojaRutaRepartidor.AgenciaID = Convert.ToInt32(Agencia);
            DsHojaRutaRepartidorOrdenes dso = new DsHojaRutaRepartidorOrdenes();

            dso = hojaRutaRepartidor.GetCodigoBarrasByOR(Orden);

            foreach (DsHojaRutaRepartidorOrdenes.DatosCBRow drr in dso.DatosCB.Rows)
            {
                datos person = new datos
                {
                    OrdenRetiroConceptoFacturacion = Convert.ToInt32(drr.OrdenRetiroConceptoFacturacion),
                    ordenRetiro     = Convert.ToInt32(drr.OrdenRetiroID),
                    descripProducto = drr.Descripcion,
                    Importe         = Convert.ToDouble(drr.ImporteConcepto),
                    CB = drr.CodigoBarras
                };

                persons.Add(person);
            }
            return(persons);
        }
Example #15
0
        public ActionResult Nuevo(DatosViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    using (CrudEntities1 bd = new CrudEntities1())
                    {
                        var odatos = new datos();
                        odatos.id               = model.id;
                        odatos.correo           = model.correo;
                        odatos.nombre           = model.nombre;
                        odatos.fecha_nacimiento = model.fecha_nacimiento;

                        bd.datos.Add(odatos);
                        bd.SaveChanges();
                    }
                    return(Redirect("~/Datos/"));
                }

                return(View(model));
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Example #16
0
        private void cmdNuevo_Click(object sender, EventArgs e)
        {
            if (this.txtID.Text == "")
            {
                MessageBox.Show("Debe de especificar el numero de salida", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                datos objDatos = new datos();
                objDatos.Conectar();
                objDatos.Consulta_llenar_datos("consultar_ultima_salida_camion " + this.txtID.Text);

                Reportes.ReporteSalida.rptUltimaSalida rp = new Reportes.ReporteSalida.rptUltimaSalida();
                rp.SetDataSource(objDatos.ds.Tables[0]);
                crystalReportViewer1.ReportSource = rp;

                crystalReportViewer1.ShowCloseButton          = false;
                crystalReportViewer1.ShowCopyButton           = false;
                crystalReportViewer1.ShowGotoPageButton       = false;
                crystalReportViewer1.ShowLogo                 = false;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.DisplayStatusBar         = false;


                crystalReportViewer1.RefreshReport();
                objDatos.Desconectar();
            }
        }
        public XmlDocument Post(datos Datos)
        {
            string UsuarioDesencripta = Seguridad.DesEncriptar(Datos.Usuario);

            DocumentoEntrada entrada = new DocumentoEntrada();

            entrada.Usuario     = UsuarioDesencripta;
            entrada.Origen      = "Programa CGE"; //Datos.Origen;
            entrada.Transaccion = 100008;
            entrada.Operacion   = 1;

            entrada.agregaElemento("SgUofUsuario", UsuarioDesencripta);

            DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

            if (respuesta.Resultado == "1")
            {
                return(respuesta.Documento);
            }
            else
            {
                var errores = respuesta.Errores;

                return(null);
            }
        }
Example #18
0
        public ActionResult DeleteConfirmed(int id)
        {
            datos datos = db.datos.Find(id);

            db.datos.Remove(datos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #19
0
        public override global::System.Data.DataSet Clone()
        {
            datos cln = ((datos)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Example #20
0
 private void startButton_Click(object sender, EventArgs e)
 {
     d = new datos(this);
     d.Hide();
     x = new details(this, d);
     x.Show();
     this.Hide();
 }
        public List <Result> PostObtieneInformes(datos Datos)
        {
            SqlCommand comando = new SqlCommand("ConsultaMaterial");

            comando.CommandType = CommandType.StoredProcedure;

            //Declaracion de parametros
            comando.Parameters.Add("@RmRdeRequisicion", SqlDbType.Int);
            comando.Parameters.Add("@TipoRequisicion", SqlDbType.Int);
            comando.Parameters.Add("@valida", SqlDbType.Bit);

            //Asignacion de valores a parametros
            comando.Parameters["@RmRdeRequisicion"].Value = Datos.RmRdeRequisicion;
            comando.Parameters["@TipoRequisicion"].Value  = Datos.TipoRequisicion;
            comando.Parameters["@valida"].Value           = Datos.valida;

            comando.Connection     = new SqlConnection(""); ///VariablesGlobales.CadenaConexionEle);
            comando.CommandTimeout = 0;
            comando.Connection.Open();
            //DA.SelectCommand = comando;
            comando.ExecuteNonQuery();

            DataTable      DT = new DataTable();
            SqlDataAdapter DA = new SqlDataAdapter(comando);

            comando.Connection.Close();
            DA.Fill(DT);

            //ObtieneInformeResult items;

            List <Result> lista = new List <Result>();

            if (DT.Rows.Count > 0)
            {
                // DataRow row = DT.Rows[0];
                foreach (DataRow row in DT.Rows)
                {
                    Result ent = new Result
                    {
                        GrMatId                = Convert.ToInt16(row["GrMatId"]),
                        GrMatNombre            = Convert.ToString(row["GrMatNombre"]),
                        GrMatPrecio            = Convert.ToDouble(row["GrMatPrecio"]),
                        GrMatIva               = Convert.ToDouble(row["GrMatIva"]),
                        GrMatGrupo             = Convert.ToInt32(row["GrMatGrupo"]),
                        GrGmaCuentaAdquisicion = Convert.ToString(row["GrGmaCuentaAdquisicion"]),
                        GrMatUnidadMedida      = Convert.ToInt32(row["GrMatUnidadMedida"])
                    };

                    lista.Add(ent);
                }

                return(lista);
            }
            else
            {
                return(null);
            }
        }
Example #22
0
        public IEnumerable <ListResult> Post(datos Datos)
        {
            // EnvioCorreosELE.Envio("", "*****@*****.**", "", "", "", "prueba", "mensaje prueba", 0);

            DocumentoEntrada entrada = new DocumentoEntrada
            {
                Usuario     = Datos.usuario,
                Origen      = "Programa CGE", //Datos.Origen;
                Transaccion = 100004,
                Operacion   = 17
            };

            entrada.agregaElemento("SgUsuId", Datos.usuario);
            entrada.agregaElemento("SgUsuClaveAcceso", Datos.contrasena);


            DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

            if (respuesta.Resultado == "1")//&& idUsuario.Trim() != ""
            {
                XmlElement tabla                          = respuesta.Tablas;
                string     SgUsuId                        = ConsultaValorRow("SgUsuId", tabla);
                string     SgUsuEmpleado                  = ConsultaValorRow("SgUsuEmpleado", tabla);
                string     GrEmpCentro                    = ConsultaValorRow("GrEmpCentro", tabla);
                string     GrEmpOficina                   = ConsultaValorRow("GrEmpOficina", tabla);
                string     GrEmpTipoGasto                 = ConsultaValorRow("GrEmpTipoGasto", tabla);
                string     SgUsuNombre                    = ConsultaValorRow("SgUsuNombre", tabla);
                string     GrEmpTarjetaToka               = ConsultaValorRow("GrEmpTarjetaToka", tabla);
                string     SgUsuFechaVencimiento          = ConsultaValorRow("SgUsuFechaVencimiento", tabla); //este campo lo acabo de agregar
                string     SgUsuMostrarGraficaAlAutorizar = ConsultaValorRow("SgUsuMostrarGraficaAlAutorizar ", tabla);

                string cosa  = Seguridad.Encriptar(SgUsuId);
                string cosa2 = Seguridad.Encriptar(Convert.ToString(SgUsuEmpleado));

                List <ListResult> lista = new List <ListResult>();

                ListResult ent = new ListResult
                {
                    cosa             = cosa,
                    cosa2            = cosa2,
                    cosa3            = SgUsuNombre,
                    GrEmpCentro      = GrEmpCentro,
                    GrEmpOficina     = GrEmpOficina,
                    GrEmpTipoGasto   = GrEmpTipoGasto,
                    GrEmpTarjetaToka = GrEmpTarjetaToka,
                    SgUsuMostrarGraficaAlAutorizar = SgUsuMostrarGraficaAlAutorizar,
                    SgUsuFechaVencimiento          = SgUsuFechaVencimiento
                };
                lista.Add(ent);

                return(lista);
            }
            else
            {
                return(null);
            }
        }
        public XmlElement Post(datos Datos)
        {
            var fechaVencimiento = DateTime.Today.Date.AddDays(1000);
            var pswEncriptado    = Encrypter.Encrypt(Datos.contrasena, Datos.usuario.ToUpper());

            DocumentoEntrada entrada = new DocumentoEntrada
            {
                Usuario     = Datos.usuario,
                Origen      = "Login Usuario",
                Transaccion = 100004,
                Operacion   = 17
            };


            entrada.agregaElemento("SgUsuId", Datos.usuario);
            entrada.agregaElemento("SgUsuClaveAcceso", pswEncriptado);
            entrada.agregaElemento("SgUsuFechaVencimiento", fechaVencimiento);

            DocumentoSalida respuesta = PeticionCatalogo(entrada.Documento);

            if (respuesta.Resultado == "1")
            {
                XmlElement tabla = respuesta.Tablas;
                //string SgUsuId = ConsultaValorRow("SgUsuId", tabla);
                //string SgUsuEmpleado = ConsultaValorRow("SgUsuEmpleado", tabla);
                //string GrEmpCentro = ConsultaValorRow("GrEmpCentro", tabla);
                //string GrEmpOficina = ConsultaValorRow("GrEmpOficina", tabla);
                //string GrEmpTipoGasto = ConsultaValorRow("GrEmpTipoGasto", tabla);
                //string SgUsuNombre = ConsultaValorRow("SgUsuNombre", tabla);
                //string GrEmpTarjetaToka = ConsultaValorRow("GrEmpTarjetaToka", tabla);
                //string SgUsuFechaVencimiento = ConsultaValorRow("SgUsuFechaVencimiento", tabla); //este campo lo acabo de agregar
                //string SgUsuMostrarGraficaAlAutorizar = ConsultaValorRow("SgUsuMostrarGraficaAlAutorizar ", tabla);

                //List<ListResult> lista = new List<ListResult>();

                //ListResult ent = new ListResult
                //{
                //    cosa = cosa,
                //    cosa2 = cosa2,
                //    cosa3 = SgUsuNombre,
                //    GrEmpCentro = GrEmpCentro,
                //    GrEmpOficina = GrEmpOficina,
                //    GrEmpTipoGasto = GrEmpTipoGasto,
                //    GrEmpTarjetaToka = GrEmpTarjetaToka,
                //    SgUsuMostrarGraficaAlAutorizar = SgUsuMostrarGraficaAlAutorizar,
                //    SgUsuFechaVencimiento = SgUsuFechaVencimiento
                //};
                //lista.Add(ent);

                return(tabla);
            }
            else
            {
                return(null);
            }
        }
Example #24
0
 public ActionResult Edit([Bind(Include = "ID,Nombre,Edad,Carrera,Cuatrimestre")] datos datos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(datos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(datos));
 }
Example #25
0
 public ActionResult Edit([Bind(Include = "ParadaId,ParadaNombre,Descrip,Parada_Lon,Parada_Lat,Parada_Cod,Boarding")] datos datos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(datos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(datos));
 }
Example #26
0
        public ActionResult Create([Bind(Include = "ParadaId,ParadaNombre,Descrip,Parada_Lon,Parada_Lat,Parada_Cod,Boarding")] datos datos)
        {
            if (ModelState.IsValid)
            {
                db.datos.Add(datos);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(datos));
        }
Example #27
0
        public ActionResult Create([Bind(Include = "ID,Nombre,Edad,Carrera,Cuatrimestre")] datos datos)
        {
            if (ModelState.IsValid)
            {
                db.datos.Add(datos);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(datos));
        }
 public void Mostrar(datos Empleado)
 {
     Console.WriteLine(Empleado.nombre);
     Console.WriteLine(Empleado.apellido);
     Console.WriteLine(Empleado.fechaNacimiento.ToShortDateString());
     Console.WriteLine(Empleado.estado);
     Console.WriteLine(Empleado.gen);
     Console.WriteLine(Empleado.fechaIngreso.ToShortDateString());
     Console.WriteLine(Empleado.sueldo);
     Console.WriteLine(Empleado.carg);
 }
Example #29
0
 void restauraMaterial(GameObject obj)
 {
     meshR = (MeshRenderer)obj.GetComponent("MeshRenderer");
     if(meshR == null)
     {
         meshR = (MeshRenderer)obj.GetComponentInChildren<MeshRenderer>();
     }
     datos datos = ((datos)obj.GetComponent("datos"));
     if (meshR != null && datos != null) {
         meshR.material = datos.materialOriginal;
     }
 }
Example #30
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            datos ds = new datos();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Example #31
0
        public static void Main(string[] args)
        {
            datos [] friends = new datos [275];

            char opcion = '0';
            int index = 0;
            byte posicion_dato;
            string tempname = "";
            string tempmail = "";
            string tempaddress = "";
            int tempyear = 0;
            bool comprobacion = false;
            bool encontrado = false;

            do
            {
                switch (opcion)
                {
                    case '1': // añade datos al final
                        while (comprobacion = false)
                        {
                            Console.WriteLine("Write the name to add:");
                            tempname = Console.ReadLine();
                            if (tempname.Length < 40)
                            {
                                friends[index].name = tempname;
                                comprobacion = true;
                            }
                        }
                        comprobacion = false;

                        while (comprobacion = false)
                        {
                            Console.WriteLine("Write the mail of the person:");
                            tempmail = Console.ReadLine();
                            if (tempmail.Length < 30)
                            {
                                friends[index].mail = tempmail;
                                comprobacion = true;
                            }
                        }
                        comprobacion = false;

                        while (comprobacion = false)
                        {
                            Console.WriteLine("Write the address of the person:");
                            tempaddress = Console.ReadLine();
                            if (tempaddress.Length < 150)
                            {
                                friends[index].address = tempaddress;
                                comprobacion = true;
                            }
                        }
                        comprobacion = false;

                        while (comprobacion = false)
                        {
                            Console.WriteLine("Write the year of the person:");
                            tempyear = Convert.ToInt16(Console.ReadLine());
                            if (tempyear > 1850 && tempyear < 2100)
                            {
                                friends[index].year = tempyear;
                                comprobacion = true;
                            }
                        }
                        comprobacion = false;
                        index++;
                        break;
                    case '2':
                        if (index == 0)
                        {
                            Console.Write("no hay datos que mostrar");
                        }
                        else
                        {
                            for (int i = 0; i < index; i++)
                            {
                                if (i > 0 && i%20 == 0)
                                {
                                    Console.WriteLine();
                                    Console.WriteLine("Pulse enter para ver los siguientes 20");
                                    Console.ReadLine();
                                }
                                if (friends[i].name.Length < 30)
                                    Console.WriteLine("{0}", friends[i].name);
                                else
                                    Console.WriteLine("{0}", friends[i].name.Substring(0, 30) + "...");
                            }
                        }
                            Console.WriteLine();
                        break;
                    case '3':

                    while (comprobacion = false)
                        {
                            Console.WriteLine("Write the name to add:");
                            tempname = Console.ReadLine();
                            if (tempname.Length < 40)
                            {
                                comprobacion = true;
                            }
                        }

                    for (int i = 0; i < index; i++)
                    {
                        if (tempname.ToLower() == friends[i].name.ToLower())
                        {
                            Console.WriteLine("{0}", friends[i].name);
                            Console.WriteLine("{0}", friends[i].mail);
                            Console.WriteLine("{0}", friends[i].address);
                            Console.WriteLine("{0}", friends[i].year);
                            i = index + 1;
                            encontrado = true;
                        }
                    }
                        if (encontrado == false)
                        {
                            Console.WriteLine("no se ha encontrado el nombre");
                        }

                        encontrado = false;
                        comprobacion = false;

                        break;
                    case '4':
                        int anyo;
                        Console.WriteLine("Escriba el primer año a comprobar");
                        int.TryParse(Console.ReadLine(), out anyo);
                        int anyo2;
                        Console.WriteLine("Escriba el segundo año a comprobar");
                        int.TryParse(Console.ReadLine(), out anyo2);

                        for (int i = 0; i < index; i++)
                        {

                        }

                        break;
                    case '5':

                        break;
                    case '6':

                        break;
                    case '7':

                        break;
                }

            } while (opcion != 'x');
        }
Example #32
0
        private void btnGeneraPdf_Click(object sender, EventArgs e)
        {
            List<String> lcodigos = new List<String>();
            List<String> lclientes = new List<String>();
            List<String> ldirecciones = new List<String>();
            List<String> lciudades = new List<String>();

            int i = 0;
            foreach (DataGridViewRow row in dgvContenedor.Rows)
            {
                datos objDatos = new datos();
                lcodigos.Add(dgvContenedor.Rows[i].Cells[0].Value.ToString());
                lclientes.Add(dgvContenedor.Rows[i].Cells[1].Value.ToString());
                ldirecciones.Add(dgvContenedor.Rows[i].Cells[2].Value.ToString());
                lciudades.Add(dgvContenedor.Rows[i].Cells[3].Value.ToString());
                i++;
            }

            generaBarcodePDF("D:\\", lcodigos, lclientes, ldirecciones, lciudades, 6);
            MessageBox.Show("yes");
        }