예제 #1
0
 protected void Page_Load(object Sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session.Clear();
         DatasToControls bind = new DatasToControls();
         bind.PutDatasIntoDropDownList(ddlAno, "SELECT pano_ano FROM pano ORDER BY pano_ano ASC");
         DatasToControls.EstablecerDefectoDropDownList(ddlAno, "" + DateTime.Now.Year + "");
         bind.PutDatasIntoDropDownList(ddlMes, "SELECT pmes_mes,pmes_nombre FROM pmes WHERE pmes_mes BETWEEN 1 AND 12 ORDER BY pmes_mes ASC");
         DatasToControls.EstablecerDefectoDropDownList(ddlMes, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + DateTime.Now.Month + ""));
         //bind.PutDatasIntoDropDownList(ddlPrefijo, "SELECT pdoc_codigo,pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='FC' and tvig_vigencia = 'V' ");
         Utils.llenarPrefijos(Response, ref ddlPrefijo, "%", "%", "FC");
         bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT palm_almacen,palm_descripcion FROM palmacen where (pcen_centcart is not null  or pcen_centteso is not null) and TVIG_VIGENCIA = 'V' order by palm_descripcion;");
     }
     else
     {
         if (Session["dtMora"] != null)
         {
             dtMora = (DataTable)Session["dtMora"];
         }
         if (Session["dtPreLiq"] != null)
         {
             dtPreLiq = (DataTable)Session["dtPreLiq"];
         }
         if (Session["detalles"] != null)
         {
             detalles = (ArrayList)Session["detalles"];
         }
         if (Session["final"] != null)
         {
             final = (ArrayList)Session["final"];
         }
         Cambiar_Pagina();
     }
 }
예제 #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                DatasToControls bind = new DatasToControls();
                string          yr   = DBFunctions.SingleData("SELECT pano_ano FROM ccontabilidad");
                bind.PutDatasIntoDropDownList(yearElim, "SELECT pano_ano FROM pano where pano_ano >= " + yr + " order by 1 desc");
                bind.PutDatasIntoDropDownList(yearEdit, "SELECT pano_ano FROM pano where pano_ano >= " + yr + " order by 1 desc");
                DatasToControls.EstablecerDefectoDropDownList(yearElim, yr);
                DatasToControls.EstablecerDefectoDropDownList(yearEdit, yr);
                bind.PutDatasIntoDropDownList(monthElim, "SELECT pmes_mes, pmes_nombre FROM pmes WHERE pmes_mes != 0 AND pmes_mes != 13 order by 1");
                bind.PutDatasIntoDropDownList(monthEdit, "SELECT pmes_mes, pmes_nombre FROM pmes WHERE pmes_mes != 0 AND pmes_mes != 13 order by 1");
                string mt = DBFunctions.SingleData("SELECT pmes_mes FROM ccontabilidad");
                DatasToControls.EstablecerDefectoDropDownList(monthEdit, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + mt + ""));
                DatasToControls.EstablecerDefectoDropDownList(monthElim, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + mt + ""));

                //bind.PutDatasIntoDropDownList(typeDoc2, "SELECT pdoc_codigo,pdoc_codigo concat ' - ' concat pdoc_nombre FROM pdocumento where tvig_vigencia is null or tvig_vigencia='V' order by pdoc_nombre");
                Utils.llenarPrefijos(Response, ref typeDoc2, "%", "%", "%");
                //bind.PutDatasIntoDropDownList(typeDoc3, "SELECT pdoc_codigo,pdoc_codigo concat ' - ' concat pdoc_nombre FROM pdocumento where tvig_vigencia is null or tvig_vigencia='V' order by pdoc_nombre");
                Utils.llenarPrefijos(Response, ref typeDoc3, "%", "%", "%");
                if (Request.QueryString["falloDoc"] == "1")
                {
                    Utils.MostrarAlerta(Response, "El proceso se realizó correctamente! \nPero se generó un error al guardar los documentos soporte.");
                }
                RecargarDatosEditar();
                RecargarDatosEliminar();
                Eliminar.Attributes.Add("onclick", "return confirm('Esta seguro de realizar este proceso?\\nLos datos eliminados no se podran recuperar.');");
            }
        }
예제 #3
0
        protected void Page_Init(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["pref"] != null && Request.QueryString["num"] != null)
                {
                    FormatosDocumentos formatoRecibo = new FormatosDocumentos();
                    formatoRecibo.Prefijo = Request.QueryString["pref"];
                    formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                    formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["num"].ToString());
                    if (formatoRecibo.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                    }
                    if (Request.QueryString["falloDoc"] == "1")
                    {
                        Utils.MostrarAlerta(Response, "Se ha realizado el proceso correctamente!! pero por un eror desconocido no ha sido posible archivar los documentos soporte, por favor contacte a ECAS");
                    }
                }

                DatasToControls bind = new DatasToControls();
                string          yr   = DBFunctions.SingleData("SELECT pano_ano FROM ccontabilidad");
                Int16           año  = Convert.ToInt16(yr);
                bind.PutDatasIntoDropDownList(year, "SELECT pano_ano, PANO_DETALLE FROM pano where pano_ano >= " + año + " order by 1 desc");
                DatasToControls.EstablecerDefectoDropDownList(year, yr);
                bind.PutDatasIntoDropDownList(month, "SELECT pmes_mes, pmes_nombre FROM pmes WHERE pmes_mes != 0 AND pmes_mes != 13 order by 1");
                string mt = DBFunctions.SingleData("SELECT pmes_mes FROM ccontabilidad");
                DatasToControls.EstablecerDefectoDropDownList(month, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + mt + ""));
                //month.SelectedIndex=month.Items.IndexOf(new ListItem(mt,mt));
                maVig.Text = "  " + month.SelectedItem + " - " + yr + " ";
                // Descarta los documentos que no esten vigentes y tambien los que NO son contables como las ordenes de trabajo o producción, cotizaciones y pedidos
                bind.PutDatasIntoDropDownList(typeDoc, "SELECT pdoc_codigo,pdoc_codigo concat ' - ' concat pdoc_nombre FROM pdocumento where tvig_vigencia='V' and tdoc_tipodocu not in ('CT','CV','PC','PV','PI','OP','OT') order by pdoc_CODIGO");
                //Utils.llenarPrefijos(Response, ref typeDoc, "%", "%", "%");
                //bind.PutDatasIntoDropDownList(typePlant, "SELECT pdoc_codigo,pdoc_codigo concat ' - ' concat pdoc_nombre FROM pdocumento where tvig_vigencia is null or tvig_vigencia='V' order by pdoc_nombre");
                Utils.llenarPrefijos(Response, ref typePlant, "%", "%", "%");
                bind.PutDatasIntoDropDownList(compPlant, "SELECT mcom_numedocu FROM mcomprobante WHERE pdoc_codigo='" + typePlant.SelectedValue + "'");
                string pathToImports = ConfigurationManager.AppSettings["PathToImports"] + "comprobantes";
                //DatasToControls bind4 = new DatasToControls("");
                //bind.BindFromDirIntoLB(compCOBOL, pathToImports);
                IFormatProvider culture = new System.Globalization.CultureInfo("es-CO", true);
                DateTime        nd      = DateTime.Now;
                try{ nd = new DateTime(Convert.ToInt16(year.SelectedValue), Convert.ToInt16(month.SelectedValue), 1); }catch {};
                //Button1.Attributes.Add("onclick","return ValidarFechaIngresoComprobante();");

                /*  validador de vigencia de documentos
                 *  PDOC_CODIGO ||'-'||PDOC_NOMBRE ||' LA RESOLUCION DE FACTURACION ESTA POR ACABARSE, FALTAN ' || (PDOC_NUMEFINA - PDOC_ULTIDOCU) ||' DOCUMENTOS'
                 *  FROM PDOCUMENTO WHERE (PDOC_NUMEFINA - PDOC_ULTIDOCU) IN (100,75,50,25,15,10,5,4,3,2,1) AND TDOC_TIPODOCU = 'FC';
                 *
                 *  SELECT PDOC_CODIGO||'-'|| PDOC_NOMBRE||' LA FECHA RESOLUCION DE FACTURACION ESTA POR VENCERSE, FALTAN ', DAYS(CURRENT DATE) -DAYS(PDOC_FINFECHRESOFACT) , ' DIAS'
                 *  FROM PDOCUMENTO WHERE (DAYS(CURRENT DATE) -DAYS(PDOC_FINFECHRESOFACT)) IN (30,20,15,10,5,4,3,2,1) AND TDOC_TIPODOCU = 'FC';
                 *
                 */
            }
        }
예제 #4
0
        protected void PublicarInformacionVendedor(string [] numLista)
        {
            ArrayList arrCodVend = new ArrayList();
            //Debemos traer los pedidos relacionados con esta lista de empaque
            DataSet da = new DataSet();

            DBFunctions.Request(da, IncludeSchema.NO, "SELECT DISTINCT pped_codigo, mped_numepedi FROM dlistaempaque WHERE mlis_numero=" + numLista[0]);
            //Traemos el codigo del almacen relacionado con la lista de empaque
            if (da.Tables[0].Rows.Count > 0)
            {
                string codAlmacen = DBFunctions.SingleData("SELECT palm_almacen FROM mpedidoitem WHERE pped_codigo='" + da.Tables[0].Rows[0][0].ToString() + "' AND mped_numepedi=" + da.Tables[0].Rows[0][1].ToString() + "");
                if (codAlmacen != "")
                {
                    DatasToControls.EstablecerDefectoDropDownList(ddlAlmacen, DBFunctions.SingleData("SELECT palm_descripcion FROM palmacen WHERE tvig_vigencia='V' and palm_almacen='" + codAlmacen + "'"));

                    if (tipoPedido == "T")
                    {
                        Utils.llenarPrefijos(Response, ref ddlCodDoc, "%", ddlAlmacen.SelectedValue, "TT");
                    }
                    else if (tipoPedido == "E")
                    {
                        Utils.llenarPrefijos(Response, ref ddlCodDoc, "%", ddlAlmacen.SelectedValue, "CI");
                    }
                    else
                    {
                        Utils.llenarPrefijos(Response, ref ddlCodDoc, "IC", ddlAlmacen.SelectedValue, "FC");
                    }

                    //  hECTOR VALIDAR QUE EL ALMACEN SEA IGUAL AL SELECCIONADO DE LA LISTA INICIAL EN CASO CONTRARIO RECHAZAR
                    for (int i = 0; i < da.Tables[0].Rows.Count; i++)
                    {
                        //Traemos el codigo del vendedor relacionado con el pedido
                        string codVendedor = DBFunctions.SingleData("SELECT pven_codigo FROM mpedidoitem WHERE pped_codigo='" + da.Tables[0].Rows[0][0].ToString() + "' AND mped_numepedi=" + da.Tables[0].Rows[0][1].ToString() + "");
                        if (arrCodVend.BinarySearch(codVendedor) < 0)
                        {
                            arrCodVend.Add(codVendedor);
                            ddlVendedor.Items.Add(new ListItem(DBFunctions.SingleData("SELECT pven_nombre FROM pvendedor WHERE pven_codigo='" + codVendedor + "'"), codVendedor));
                        }
                    }
                    if (arrCodVend.Count == 1)
                    {
                        ddlVendedor.Enabled = false;
                    }
                }
                else
                {
                    DatasToControls bind = new DatasToControls();
                    // Ayco     bind.PutDatasIntoDropDownList(ddlVendedor,"SELECT pven_codigo, pven_nombre FROM pvendedor WHERE palm_almacen='"+ddlAlmacen.SelectedValue+"'");
                    bind.PutDatasIntoDropDownList(ddlVendedor, "SELECT pven_codigo, pven_nombre FROM pvendedor WHERE TVEND_CODIGO IN ('TT','VM') AND tvig_vigencia = 'V' ORDER BY pven_nombre");
                }
            }
        }
예제 #5
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     tipoProceso   = Request.QueryString["tipProc"];
     codigoAlmacen = Request.QueryString["codAlma"];
     codItem       = Request.QueryString["codItem"];
     codOriginal   = Request.QueryString["codOri"];
     nivel         = 0;
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT palm_almacen, palm_descripcion FROM palmacen");
         DatasToControls.EstablecerDefectoDropDownList(ddlAlmacen, DBFunctions.SingleData("SELECT palm_descripcion FROM palmacen WHERE palm_almacen='" + codigoAlmacen + "'"));
         bind.PutDatasIntoDropDownList(ddlUbiNiv1, "SELECT pubi_codigo, pubi_nombre FROM pubicacionitem WHERE palm_almacen='" + ddlAlmacen.SelectedValue + "' AND pubi_codpad IS NULL");
         lbCodI.Text           = codItem;
         lbNomI.Text           = DBFunctions.SingleData("SELECT mite_nombre FROM mitems WHERE mite_codigo='" + codOriginal + "'");
         lbLinBod.Text         = DBFunctions.SingleData("SELECT plin_nombre FROM plineaitem WHERE plin_codigo=(SELECT plin_codigo FROM mitems WHERE mite_codigo='" + codOriginal + "')");
         plInfoUbiNiv2.Visible = plInfoUbiNiv3.Visible = false;
         if (tipoProceso == "N")
         {
             ddlAlmacen.Enabled = false;
         }
     }
     //Manejo de Nivel
     if (Request.QueryString["codUbicacion"] == null || Request.QueryString["codUbicacion"] == "")
     {
         //Debemos cargar la configuracion de la ubicacion de nivel 1 que se encuentra dentro de ddlUbiNiv1
         if (ddlUbiNiv1.Items.Count == 0)
         {
             Response.Write("<script language='javascript'>alert('No se tiene ninguna configurada ninguna ubicación de nivel 1 para el almacen " + ddlAlmacen.SelectedItem.Text + ".\\nRevise Por Favor!');</script>");
         }
         else
         {
             codigoUbicacion       = ddlUbiNiv1.SelectedValue;
             nivel                 = DeterminarNivel(codigoUbicacion);
             plInfoUbiNiv2.Visible = true;
         }
     }
     else
     {
         codigoUbicacion       = Request.QueryString["codUbicacion"];
         nivel                 = DeterminarNivel(codigoUbicacion);
         plInfoUbiNiv3.Visible = lnkVolver.Visible = true;
     }
     //Fin manejo de nivel
     //Manejo de grilla
     if (nivel != 0)
     {
         LlenarGrilla(codigoUbicacion);
         FormatoPrimerColumna();
     }
     //Fin Manejo de grilla
 }
예제 #6
0
 protected void Page_Load(object Sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //Session.Clear();
         DatasToControls bind = new DatasToControls();
         if (((ArrayList)Session["facturas"]) == null)
         {
         }
         else if (((ArrayList)Session["facturas"]).Count != 0)
         {
             for (int i = 0; i < ((ArrayList)Session["facturas"]).Count; i++)
             {
                 string[] partes = ((ArrayList)Session["facs"])[i].ToString().Split('-');
                 Utils.MostrarAlerta(Response, "Se han creado las facturas de cliente con prefijo prefijo " + partes[0] + " y número " + partes[1] + " ");
                 try
                 {
                     Imprimir.ImprimirRPT(Response, partes[0], Convert.ToInt32(partes[1]), true);
                 }
                 catch
                 {
                     lb.Text += "Error al generar la impresión.";
                 }
             }
         }
         if (Request.QueryString["tipo"] == "C")
         {
             Utils.llenarPrefijos(Response, ref ddlPrefijo, "%", "%", "FC");
         }
         else if (Request.QueryString["tipo"] == "P")
         {
             Utils.llenarPrefijos(Response, ref ddlPrefijo, "%", "%", "FP");
         }
         bind.PutDatasIntoDropDownList(ddlMes, "SELECT pmes_mes,pmes_nombre FROM dbxschema.pmes ORDER BY pmes_mes");
         DatasToControls.EstablecerDefectoDropDownList(ddlMes, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + DateTime.Now.Month + ""));
         bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT palm_almacen,palm_descripcion FROM dbxschema.palmacen where (pcen_centcart is not null  or pcen_centteso is not null) and TVIG_VIGENCIA = 'V' order by palm_descripcion;");
         this.Mostrar_Causacion(null, null);
     }
     else
     {
         if (Session["dtConceptos"] != null)
         {
             dtConceptos = (DataTable)Session["dtConceptos"];
         }
         if (Session["facs"] != null)
         {
             facs = (ArrayList)Session["facs"];
         }
     }
 }
예제 #7
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         //bind.PutDatasIntoDropDownList(taller,"SELECT palm_descripcion FROM palmacen WHERE talm_tipoalma='T' ORDER BY palm_almacen ASC");
         bind.PutDatasIntoDropDownList(taller, "SELECT palm_descripcion FROM palmacen pa where (pa.pcen_centtal is not null  or pcen_centcoli is not null) and pa.tvig_vigencia='V' order by pa.PALM_DESCRIPCION;");
         bind.PutDatasIntoDropDownList(tipoOrden, "SELECT remarks FROM sysibm.syscolumns WHERE tbcreator='DBXSCHEMA' AND tbname='MCITATALLER'");
         DatasToControls.EstablecerDefectoDropDownList(tipoOrden, "Hora de la cita");
         fechaInicial.SelectedDate = DateTime.Now;
         fechaFinal.SelectedDate   = DateTime.Now;
     }
     this.Construccion_Controles_Consulta_Avanzada();
 }
예제 #8
0
 protected void Page_Load(object Sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session.Clear();
         DatasToControls bind = new DatasToControls();
         bind.PutDatasIntoDropDownList(ddlCC, "SELECT pcue_codigo,pcue_codigo CONCAT ' - ' CONCAT pban_nombre CONCAT ' - ' CONCAT pcue_numero  FROM dbxschema.pcuentacorriente pc, dbxschema.pbanco pb where pc.pban_banco = pb.pban_codigo ORDER BY PCUE_CODIGO");
         bind.PutDatasIntoDropDownList(ddlMes, "SELECT pmes_mes,pmes_nombre FROM dbxschema.pmes  WHERE pmes_mes BETWEEN 1 AND 12 ORDER BY pmes_mes");
         DatasToControls.EstablecerDefectoDropDownList(ddlMes, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + DateTime.Now.Month + ""));
     }
     else
     {
     }
 }
예제 #9
0
        protected void GuardarDoc(Object Sender, System.EventArgs e)
        {
            if (txtFechaDoc.Text == "" || txtFechaVencDoc.Text == "")
            {
                Utils.MostrarAlerta(Response, "Las fechas son campos obligatorios!");
                DatasToControls postVin = new DatasToControls();
                postVin.PutDatasIntoDropDownList(ddlVin, "SELECT MV.MCAT_VIN AS VIN FROM MVEHICULO MV, mcatalogovehiculo MC WHERE MC.MCAT_VIN = MV.MCAT_VIN AND MC.PCAT_CODIGO='" + ddlcatalogo.SelectedValue + "'");
                return;
            }

            if (ddlEntreCli.SelectedIndex == 2)
            {
                Utils.MostrarAlerta(Response, "No ha seleccionado si fue entregado al cliente o no..");
                DatasToControls postVin = new DatasToControls();
                postVin.PutDatasIntoDropDownList(ddlVin, "SELECT MV.MCAT_VIN AS VIN FROM MVEHICULO MV, mcatalogovehiculo MC WHERE MC.MCAT_VIN = MV.MCAT_VIN AND MC.PCAT_CODIGO='" + ddlcatalogo.SelectedValue + "'");
                return;
            }
            DBFunctions.NonQuery("delete from dbxschema.mvehiculodocumento where mcat_vin='" + ddlVinS + "' and pdoc_codidocu='" + ddlCodDocS + "'");
            DBFunctions.NonQuery("insert into dbxschema.MVEHICULODOCUMENTO values (default,'" + ddlVinS + "','" + ddlCodDocS + "','" + txtNumDocS + "','" + txtFechaDocS + "'," + txtValoDocS + ",'" + txtFechaVencDocS + "','" + txtObservaS + "','" + txtTramitadorS + "','" + ddlEntreCli.SelectedValue + "',NULL)");
            DataSet d = new DataSet();

            DBFunctions.Request(d, IncludeSchema.NO, "select MVEH_CODIGO,PCAT_CODIGO,mvd.MCAT_VIN,PDOC_CODIDOCU,MVEH_NUMEDOCU,MVEH_FECHINGRESO,MVEH_VALODOCU,MVEH_FECHENTREGA,MVEH_OBSERVAC,MVEH_NOMBRETRAMITA,TRES_SINO from dbxschema.mvehiculodocumento mvd, mcatalogovehiculo mc where MC.PCAT_CODIGO='" + ddlcatalogoS + "' and mvd.mcat_vin='" + ddlVinS + "' and PDOC_CODIDOCU='" + ddlCodDocS + "' and mvd.mcat_vin = mc.mcat_vin ");
            if (d.Tables[0].Rows.Count == 0)
            {
                Utils.MostrarAlerta(Response, "Algo está mal con los datos insertados..");
                return;
            }
            txtFechaDoc.Text     = Convert.ToDateTime(d.Tables[0].Rows[0][5]).ToString("yyyy-MM-dd");
            txtFechaVencDoc.Text = Convert.ToDateTime(d.Tables[0].Rows[0][7]).ToString("yyyy-MM-dd");
            txtValoDoc.Text      = d.Tables[0].Rows[0][6].ToString();
            txtObserva.Text      = d.Tables[0].Rows[0][8].ToString();
            txtTramitador.Text   = d.Tables[0].Rows[0][9].ToString();
            txtNumDoc.Text       = d.Tables[0].Rows[0][4].ToString();
            //DatasToControls.EstablecerDefectoDropDownList(ddl);
            DatasToControls param = new DatasToControls();

            param.PutDatasIntoDropDownList(ddlVin, "SELECT MV.MCAT_VIN AS VIN FROM MVEHICULO MV, mcatalogovehiculo MC WHERE MC.MCAT_VIN = MV.MCAT_VIN AND MC.PCAT_CODIGO= '" + ddlcatalogoS + "'");
            DatasToControls.EstablecerDefectoDropDownList(ddlVin, ddlVinS);

            Utils.MostrarAlerta(Response, "Información actualizada correctamente!");
        }
예제 #10
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     //Ajax.Utility.RegisterTypeForAjax(typeof(AMS.Automotriz.DatosPropietario));// cambio realizado 1 febrero
     strDatosC = Request.Form[datosc.UniqueID];
     strDatosE = Request.Form[datose.UniqueID];
     strDatosF = Request.Form[datosf.UniqueID];
     strDatosG = Request.Form[datosg.UniqueID];
     strDatosH = Request.Form[datosh.UniqueID];
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         bind.PutDatasIntoRadioButtonList(tipoCliente, "SELECT tpro_codigo, tpro_nombre FROM tpropietariotaller");
         bind.PutDatasIntoDropDownList(tipoPago, "SELECT ttip_codigo ,ttip_nombre FROM dbxschema.ttipopago where ttip_codigo<>'DL' and ttip_codigo <> 'DC'");
         tipoPago.Items.Insert(0, "Seleccione..");
         bind.PutDatasIntoDropDownList(datosd, "SELECT pciu_codigo AS CODIGO,pciu_nombre AS CIUDAD FROM dbxschema.pciudad ORDER BY pciu_nombre asc");
         datosd.Items.Insert(0, "Seleccione..");
         bind.PutDatasIntoDropDownList(tipid, "SELECT TNIT_TIPONIT, TNIT_NOMBRE from TNIT order by 2");
         tipid.Items.Insert(0, "");
         DatasToControls.EstablecerDefectoRadioButtonList(tipoCliente, "Propietario");
         DatasToControls.EstablecerDefectoDropDownList(tipoPago, "Efectivo");
     }
 }
예제 #11
0
 public void llenarListaDias(System.Web.UI.WebControls.DropDownList LB, string dia)
 {
     DTC.PutDatasIntoDropDownList(LB, "Select TDIA_DIA, TDIA_NOMBRE from TDIA order by 1");
     DatasToControls.EstablecerDefectoDropDownList(LB, dia);
 }
예제 #12
0
 public void llenarListaMeses(System.Web.UI.WebControls.DropDownList LB, string mes)
 {
     DTC.PutDatasIntoDropDownList(LB, "Select PMES_MES, PMES_NOMBRE from PMES order by 1");
     DatasToControls.EstablecerDefectoDropDownList(LB, mes);
 }
예제 #13
0
 public void llenarListaAños(System.Web.UI.WebControls.DropDownList LB, string ano)
 {
     DTC.PutDatasIntoDropDownList(LB, "SELECT PANO_ANO,PANO_DETALLE FROM PANO order by 1 desc");
     DatasToControls.EstablecerDefectoDropDownList(LB, ano);
 }
예제 #14
0
        public void Confirmar(Object Sender, EventArgs e)
        {
            string error   = RevisionParametros();
            string ordenes = "";

            string prefijo = tipoDocumento.SelectedValue;
            string numero  = numOrden.Text;

            while (DBFunctions.RecordExist("select * from dbxschema.morden where pdoc_codigo='" + prefijo + "' and mord_numeorde=" + numero + ""))
            {
                numero = Convert.ToString(Convert.ToInt32(numero) + 1);
            }
            if (DBFunctions.RecordExist("select * from dbxschema.morden where pdoc_codigo='" + prefijo + "' and mord_numeorde=" + numero + ""))
            {
                numero = Convert.ToString(Convert.ToInt32(numero) + 1);
                Utils.MostrarAlerta(Response, "El Numero de Orden ya existe, sera asignado el siguiente " + numero + "");
                return;
            }


            if (error != "")
            {
                Utils.MostrarAlerta(Response, "" + error + "");
                return;
            }

            if (ExistenOrdenes(placa.Text, ref ordenes))
            {
                Utils.MostrarAlerta(Response, "Este vehículo tiene las siguientes ordenes de trabajo abiertas \\n" + ordenes + "");
            }

            if (DBFunctions.RecordExist("SELECT MG.MCAT_VIN FROM MCATALOGOVEHICULO MC, MPLANGARANTIA MG WHERE MC.MCAT_PLACA = '" + placa.Text + "' AND MC.MCAT_VIN = MG.MCAT_VIN AND (MG.PDOC_CODIGO = '' OR MG.PDOC_CODIGO IS NULL)"))
            {
                Utils.MostrarAlerta(Response, "Este vehículo tiene CAMPAÑA de GARANTÍA de FÁBRICA \\n");
            }

            //verificacion de clave valida, a futuro debe modificarse para almacenar claves codificadas

            if (clave.Text == (DBFunctions.SingleData("SELECT pven_clave FROM pvendedor WHERE pven_codigo='" + codigoRecep.SelectedValue + "'")) && codigoRecep.SelectedValue != "0")
            {
                //Aqui Debemos Habilitar los controles del placeholder datosPropietario
                Control principal = (this.Parent).Parent; //Control principal ascx
                Control controlDatosPropietario = ((PlaceHolder)principal.FindControl("datosPropietario")).Controls[0];
                Control controlDatosVehiculo    = ((PlaceHolder)principal.FindControl("datosVehiculo")).Controls[0];
                Control controlKitsCombos       = ((PlaceHolder)principal.FindControl("kitsCombos")).Controls[0];

                if (DBFunctions.RecordExist("SELECT mcat_placa FROM mcatalogovehiculo WHERE mcat_placa='" + placa.Text + "'"))
                {
                    //Aqui cargamos los datos del cliente en el control respectivo al cliente
                    string  mnit         = DBFunctions.SingleData("SELECT mnit_nit FROM mcatalogovehiculo WHERE mcat_placa='" + placa.Text + "'");
                    DataSet datosCliente = new DataSet();
                    DBFunctions.Request(datosCliente, IncludeSchema.NO, "SELECT mnit_nit , mnit_nombres concat ' ' concat coalesce(mnit_nombre2,'') , mnit_apellidos concat ' ' concat coalesce(mnit_apellido2,'') , mnit_direccion, pciu_codigo, mnit_telefono, mnit_celular, mnit_email, mnit_web FROM mnit WHERE mnit_nit='" + mnit + "'");
                    ((TextBox)controlDatosPropietario.FindControl("datos")).Text  = datosCliente.Tables[0].Rows[0][0].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datosa")).Text = datosCliente.Tables[0].Rows[0][1].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datosb")).Text = datosCliente.Tables[0].Rows[0][2].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datosc")).Text = datosCliente.Tables[0].Rows[0][3].ToString();
                    //string ciudad=Convert.ToString(DBFunctions.SingleData("select pciu_nombre from dbxschema.pciudad where pciu_codigo="+datosCliente.Tables[0].Rows[0][4].ToString()+""));
                    ((DropDownList)controlDatosPropietario.FindControl("datosd")).SelectedValue = datosCliente.Tables[0].Rows[0][4].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datose")).Text     = datosCliente.Tables[0].Rows[0][5].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datosf")).Text     = datosCliente.Tables[0].Rows[0][6].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datosg")).Text     = datosCliente.Tables[0].Rows[0][7].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datosh")).Text     = datosCliente.Tables[0].Rows[0][8].ToString();
                    ((TextBox)controlDatosPropietario.FindControl("datos")).ReadOnly  = true;
                    ((TextBox)controlDatosPropietario.FindControl("datosa")).ReadOnly = true;
                    ((TextBox)controlDatosPropietario.FindControl("datosb")).ReadOnly = true;
                    //((Button)controlDatosPropietario.FindControl("confirmar")).Enabled = true;
                    //Aqui cargamos los datos del vehiculo  en el control respectivo del vehiculo
                    DataSet datosVehiculo = new DataSet();
                    DBFunctions.Request(datosVehiculo, IncludeSchema.NO, "SELECT pcat_codigo, mcat_vin, mcat_motor, mcat_serie, mcat_anomode, pcol_codigo, tser_tiposerv, mcat_concvend, mcat_venta, mcat_numeradio, mcat_numekilovent, mcat_numeultikilo, mcat_numekiloprom, mcat_vencseguobli FROM mcatalogovehiculo WHERE mcat_placa='" + placa.Text + "'");
                    //                                                            0            1           2           3             4           5                6       7              8                 9                10               11                   12            13
                    ((TextBox)controlDatosVehiculo.FindControl("identificacion")).Text       = datosVehiculo.Tables[0].Rows[0][1].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("identificacion")).Enabled    = false;
                    ((TextBox)controlDatosVehiculo.FindControl("motor")).Text                = datosVehiculo.Tables[0].Rows[0][2].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("motor")).Enabled             = false;
                    ((TextBox)controlDatosVehiculo.FindControl("serie")).Text                = datosVehiculo.Tables[0].Rows[0][3].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("serie")).Enabled             = false;
                    ((TextBox)controlDatosVehiculo.FindControl("anoModelo")).Text            = datosVehiculo.Tables[0].Rows[0][4].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("anoModelo")).Enabled         = false;
                    ((TextBox)controlDatosVehiculo.FindControl("consVendedor")).Text         = datosVehiculo.Tables[0].Rows[0][7].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("consVendedor")).Enabled      = false;
                    ((TextBox)controlDatosVehiculo.FindControl("fechaCompra")).Text          = System.Convert.ToDateTime(datosVehiculo.Tables[0].Rows[0][8].ToString()).ToString("yyyy-MM-dd");
                    ((TextBox)controlDatosVehiculo.FindControl("fechaCompra")).Enabled       = false;
                    ((TextBox)controlDatosVehiculo.FindControl("codRadio")).Text             = datosVehiculo.Tables[0].Rows[0][9].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("kilometraje")).Text          = Convert.ToDouble(datosVehiculo.Tables[0].Rows[0][11].ToString()).ToString("n");
                    ((TextBox)controlDatosVehiculo.FindControl("kilometrajeCompra")).Text    = datosVehiculo.Tables[0].Rows[0][10].ToString();
                    ((TextBox)controlDatosVehiculo.FindControl("kilometrajeCompra")).Enabled = false;
                    //DatasToControls.EstablecerDefectoDropDownList(((DropDownList)controlDatosVehiculo.FindControl("modelo")),datosVehiculo.Tables[0].Rows[0][0].ToString().Trim() +" - "+DBFunctions.SingleData("SELECT pcat_descripcion FROM dbxschema.pcatalogovehiculo WHERE pcat_codigo='"+datosVehiculo.Tables[0].Rows[0][0].ToString().Trim()+"'"));
                    // AYCO		((DropDownList)controlDatosVehiculo.FindControl("modelo")).SelectedValue = datosVehiculo.Tables[0].Rows[0][0].ToString().Trim();
                    ((DropDownList)controlDatosVehiculo.FindControl("modelo")).SelectedValue = datosVehiculo.Tables[0].Rows[0][0].ToString();
                    //((DropDownList)controlDatosVehiculo.FindControl("modelo")).SelectedValue = datosVehiculo.Tables[0].Rows[0][0].ToString();
                    //DatasToControls.EstablecerDefectoDropDownList(((DropDownList)controlDatosVehiculo.FindControl("modelo")),datosVehiculo.Tables[0].Rows[0][0].ToString() +" - "+DBFunctions.SingleData("SELECT pcat_descripcion FROM dbxschema.pcatalogovehiculo WHERE pcat_codigo='"+datosVehiculo.Tables[0].Rows[0][0].ToString()+"'"));
                    ((DropDownList)controlDatosVehiculo.FindControl("modelo")).Enabled = false;
                    controlDatosVehiculo.FindControl("imglupaCatalogo").Visible        = false;
                    DatasToControls.EstablecerDefectoDropDownList(((DropDownList)controlDatosVehiculo.FindControl("color")), DBFunctions.SingleData("SELECT pcol_descripcion FROM pcolor WHERE pcol_codigo='" + datosVehiculo.Tables[0].Rows[0][5].ToString() + "'").Trim());
                    ((DropDownList)controlDatosVehiculo.FindControl("color")).Enabled = false;
                    DatasToControls.EstablecerDefectoDropDownList(((DropDownList)controlDatosVehiculo.FindControl("tipo")), DBFunctions.SingleData("SELECT tser_nombserv FROM tserviciovehiculo WHERE tser_tiposerv='" + datosVehiculo.Tables[0].Rows[0][6].ToString() + "'").Trim());
                    ((DropDownList)controlDatosVehiculo.FindControl("tipo")).Enabled = false;
                    //((Button)controlDatosVehiculo.FindControl("confirmar")).Enabled = true;
                    //((ImageButton)principal.FindControl("otros")).Enabled = true;
                    //((ImageButton)principal.FindControl("botonKits")).Enabled = true;
                    ((TextBox)controlKitsCombos.FindControl("valToInsertar1EX")).Text = DBFunctions.SingleData("SELECT pgru_grupo FROM pcatalogovehiculo WHERE pcat_codigo='" + datosVehiculo.Tables[0].Rows[0][0].ToString() + "'");
                    Session["kitsTabla"] = null;
                }
                else
                {
                    //En caso que no exista el automovil que entra al taller
                    //((Button)controlDatosPropietario.FindControl("confirmar")).Enabled = true;
                    ((Button)controlDatosVehiculo.FindControl("confirmar")).Enabled = true;
                    //Limpiamos los controles de usuario de propietario y de vehiculos
                    ((TextBox)controlDatosPropietario.FindControl("datos")).Text     = "";
                    ((TextBox)controlDatosPropietario.FindControl("datos")).ReadOnly = false;
                    ((TextBox)controlDatosPropietario.FindControl("datosa")).Text    = "";
                    ((TextBox)controlDatosPropietario.FindControl("datosb")).Text    = "";
                    ((TextBox)controlDatosPropietario.FindControl("datosc")).Text    = "";
                    ((TextBox)controlDatosPropietario.FindControl("datose")).Text    = "";
                    ((TextBox)controlDatosPropietario.FindControl("datosg")).Text    = "";
                    //((Button)controlDatosPropietario.FindControl("confirmar")).Enabled = true;
                    ////////////////////////////////////////////////////////////////////
                    ((TextBox)controlDatosVehiculo.FindControl("identificacion")).Text    = "";
                    ((TextBox)controlDatosVehiculo.FindControl("motor")).Text             = "";
                    ((TextBox)controlDatosVehiculo.FindControl("serie")).Text             = "";
                    ((TextBox)controlDatosVehiculo.FindControl("anoModelo")).Text         = "";
                    ((TextBox)controlDatosVehiculo.FindControl("consVendedor")).Text      = "";
                    ((TextBox)controlDatosVehiculo.FindControl("fechaCompra")).Text       = "";
                    ((TextBox)controlDatosVehiculo.FindControl("codRadio")).Text          = "";
                    ((TextBox)controlDatosVehiculo.FindControl("kilometrajeCompra")).Text = "";
                    ((DropDownList)controlDatosVehiculo.FindControl("modelo")).Enabled    = true;
                    controlDatosVehiculo.FindControl("imglupaCatalogo").Visible           = true;
                    ((DropDownList)controlDatosVehiculo.FindControl("color")).Enabled     = true;
                    ((DropDownList)controlDatosVehiculo.FindControl("tipo")).Enabled      = true;
                    //((Button)controlDatosVehiculo.FindControl("confirmar")).Enabled = true;
                    ((TextBox)controlDatosVehiculo.FindControl("identificacion")).Enabled    = true;
                    ((TextBox)controlDatosVehiculo.FindControl("motor")).Enabled             = true;
                    ((TextBox)controlDatosVehiculo.FindControl("serie")).Enabled             = true;
                    ((TextBox)controlDatosVehiculo.FindControl("anoModelo")).Enabled         = true;
                    ((TextBox)controlDatosVehiculo.FindControl("consVendedor")).Enabled      = true;
                    ((TextBox)controlDatosVehiculo.FindControl("fechaCompra")).Enabled       = true;
                    ((TextBox)controlDatosVehiculo.FindControl("codRadio")).Enabled          = true;
                    ((TextBox)controlDatosVehiculo.FindControl("kilometrajeCompra")).Enabled = true;
                    //((TextBox)controlDatosVehiculo.FindControl("clave")).Enabled = true;
                    /////////////////////////////////////////////////////////////////////////
                    /// se colocan los datos botones que manejan el control de usuario de los
                    ///  otros datos del carro y de los kits en falso
                    //((ImageButton)principal.FindControl("otros")).Enabled = false;
                    //((ImageButton)principal.FindControl("botonKits")).Enabled = false;
                }
                if (cargo.SelectedValue == "S")
                {
                    //Activo los TextBox Correspondientes a Datos Aseguradora
                    ((TextBox)controlDatosVehiculo.FindControl("nitAseguradora")).Enabled            = true;
                    ((TextBox)controlDatosVehiculo.FindControl("siniestro")).Enabled                 = true;
                    ((TextBox)controlDatosVehiculo.FindControl("porcentajeDeducible")).Enabled       = true;
                    ((TextBox)controlDatosVehiculo.FindControl("valorMinDeducible")).Enabled         = true;
                    ((TextBox)controlDatosVehiculo.FindControl("numeroAutorizacionAsegura")).Enabled = true;
                    ((TextBox)controlDatosVehiculo.FindControl("nitCompania")).Enabled               = false;
                    ((TextBox)controlDatosVehiculo.FindControl("numeroAutorizacionGarant")).Enabled  = false;
                }
                else if (cargo.SelectedValue == "G")
                {
                    //Activo los TextBox Correspondiente a los datos de la garantia
                    ((TextBox)controlDatosVehiculo.FindControl("nitCompania")).Enabled = true;
                    ((TextBox)controlDatosVehiculo.FindControl("numeroAutorizacionGarant")).Enabled = true;
                    ((TextBox)controlDatosVehiculo.FindControl("nitAseguradora")).Enabled           = false;
                    ((TextBox)controlDatosVehiculo.FindControl("siniestro")).Enabled                 = false;
                    ((TextBox)controlDatosVehiculo.FindControl("porcentajeDeducible")).Enabled       = false;
                    ((TextBox)controlDatosVehiculo.FindControl("valorMinDeducible")).Enabled         = false;
                    ((TextBox)controlDatosVehiculo.FindControl("numeroAutorizacionAsegura")).Enabled = false;
                }
                else
                {
                    ((TextBox)controlDatosVehiculo.FindControl("nitCompania")).Enabled = false;
                    ((TextBox)controlDatosVehiculo.FindControl("numeroAutorizacionGarant")).Enabled = false;
                    ((TextBox)controlDatosVehiculo.FindControl("nitAseguradora")).Enabled           = false;
                    ((TextBox)controlDatosVehiculo.FindControl("siniestro")).Enabled                 = false;
                    ((TextBox)controlDatosVehiculo.FindControl("porcentajeDeducible")).Enabled       = false;
                    ((TextBox)controlDatosVehiculo.FindControl("valorMinDeducible")).Enabled         = false;
                    ((TextBox)controlDatosVehiculo.FindControl("numeroAutorizacionAsegura")).Enabled = false;
                }
                //((PlaceHolder)this.Parent).Visible = false;
                //((PlaceHolder)principal.FindControl("datosPropietario")).Visible = true;

                //((ImageButton)principal.FindControl("origen")).ImageUrl="../img/AMS.BotonExpandir.png";
                //((ImageButton)principal.FindControl("propietario")).Enabled = true;
                //((ImageButton)principal.FindControl("propietario")).ImageUrl="../img/AMS.BotonContraer.png";
                //((ImageButton)principal.FindControl("vehiculo")).Enabled = true;
                //En caso que nuestro cliente venga por un peritaje, debemos entonces cargar en la grilla de operaciones la operacion de peritaje y desahibilitar los otros controles
                if (servicio.SelectedValue == "P")
                {
                    // ((DataGrid)controlKitsCombos.FindControl("kitsCompletos")).Enabled = false;
                    //((DataGrid)controlKitsCombos.FindControl("kitsItems")).Enabled = false;
                    //((DataGrid)controlKitsCombos.FindControl("kitsItems")).ShowFooter = false;
                    //Ahora creamos una tabla que me permita almacenar la operacion de peritaje
                    string    codigoOperacionPeritaje = DBFunctions.SingleData("SELECT ptem_operacion FROM ctaller");
                    DataTable tablaOperaciones        = new DataTable();
                    tablaOperaciones = this.Preparar_Tabla_Operaciones(tablaOperaciones);
                    //Creamos la Fila
                    DataRow fila = tablaOperaciones.NewRow();
                    fila["CODIGOOPERACION"] = codigoOperacionPeritaje;
                    fila["NOMBRE"]          = DBFunctions.SingleData("SELECT ptem_descripcion FROM ptempario WHERE ptem_operacion='" + codigoOperacionPeritaje + "'");
                    fila["TIEMPOEST"]       = 0;
                    string excencionIva = DBFunctions.SingleData("SELECT ptem_exceiva FROM ptempario WHERE ptem_operacion='" + codigoOperacionPeritaje + "'");
                    if (excencionIva == "S")
                    {
                        fila["EXCENTOIVA"] = "SI";
                    }
                    else if (excencionIva == "N")
                    {
                        fila["EXCENTOIVA"] = "NO";
                    }
                    fila["MECANICO"]       = this.Buscar_Mecanico_Peritaje();
                    fila["CARGO"]          = cargo.SelectedItem.Text;
                    fila["ESTADO"]         = DBFunctions.SingleData("SELECT test_nombre FROM testadooperacion WHERE test_estaOPER = 'A'");
                    fila["VALOROPERACION"] = DBFunctions.SingleData("SELECT ptem_valooper FROM ptempario WHERE ptem_operacion='" + codigoOperacionPeritaje + "'");

                    tablaOperaciones.Rows.Add(fila);
                    Session["operaciones"] = tablaOperaciones;
                    //Final de la creacion de la fila
                    //Ahora asociamos la tabla a la grilla
                    //((DataGrid)controlKitsCombos.FindControl("kitsOperaciones")).ShowFooter = false;
                    ((DataGrid)controlKitsCombos.FindControl("kitsOperaciones")).DataSource = tablaOperaciones;
                    ((DataGrid)controlKitsCombos.FindControl("kitsOperaciones")).DataBind();
                    //Por ahora suponemos que la operacion de peritaje siempre va a ser de tipo Bono
                    ((TextBox)((DataGrid)controlKitsCombos.FindControl("kitsOperaciones")).Items[0].Cells[5].Controls[1]).Visible = true;
                    //((Button)((DataGrid)controlKitsCombos.FindControl("kitsOperaciones")).Items[0].Cells[14].Controls[1]).Enabled = false;
                    //Ahora Activamos el Boton de Confirmacion y agregamos datos a los TextBox de fecha y hora
                    ((Button)controlKitsCombos.FindControl("confirmar")).Enabled   = true;
                    ((TextBox)controlKitsCombos.FindControl("fechaEstimada")).Text = DateTime.Now.Date.ToString("yyyy-MM-dd");
                    ((TextBox)controlKitsCombos.FindControl("horaEstimada")).Text  = (DateTime.Now.TimeOfDay.ToString()).Substring(0, 5);
                }
                //Modificacion hecha el 2005-06-01
                //Se bloqueara el acceso a esta pantalla, para evitar que los usuarios realicen cambios al cargo de la orden, y por lo tanto
                //Se vean afectados los cargos de las operaciones o items
                //((ImageButton)principal.FindControl("origen")).Enabled = false;



                // Se reinician las grillas de kits combos
                KitsCombos inst = (KitsCombos)((PlaceHolder)principal.FindControl("kitsCombos")).Controls[0];
                inst.InicializarGrillas();
                Revision_Cita();
                HiddenField hdTabIndex = ((HiddenField)principal.FindControl("hdTabIndex"));
                hdTabIndex.Value = "1";
            }
            else
            {
                Utils.MostrarAlerta(Response, "Clave Recepcionista Invalida");
            }
        }
예제 #15
0
        protected void Cargar_Datos(string catalogo, string vin)
        {
            //Posible cambio : utilizar el request y traer todos los datos en una sola llamada a la base de datos o seguir haciendo llamada a llamada
            cataVehiculo.Text   = catalogo;
            vinVehiculo.Text    = vin;
            txtVinVehiculo.Text = vin;
            DataSet ds = new DataSet();

            numeInventario.Text = DBFunctions.SingleData("SELECT max(mveh_inventario) FROM mvehiculo WHERE mcat_vin='" + vin + "'");
            DBFunctions.Request(ds, IncludeSchema.NO, @"SELECT max(mveh_inventario) as inventario,  mped_numero, 
                                                        mveh_valoinfl, mveh_numerece, mveh_fechrece, mveh_fechdisp, mveh_kilometr, mveh_numemani, mveh_fechmani, 
                                                        mveh_aduana, mveh_numed_o, mveh_numelevante, mveh_valogast, mnit_nit, mveh_fechentr FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + @" group by mveh_inventario ,  mped_numero, 
                                                        mveh_valoinfl, mveh_numerece, mveh_fechrece, mveh_fechdisp, mveh_kilometr, mveh_numemani, mveh_fechmani, 
                                                        mveh_aduana, mveh_numed_o, mveh_numelevante, mveh_valogast, mnit_nit, mveh_fechentr;");


            prefPedido.Text = DBFunctions.SingleData("SELECT pdoc_nombre FROM pdocumento WHERE pdoc_codigo=(SELECT pdoc_codigopediprov FROM mvehiculo WHERE mcat_vin='" + vin + "')");
            numePedido.Text = ds.Tables[0].Rows[0]["mped_numero"].ToString();
            DatasToControls.EstablecerDefectoDropDownList(ddlCataVehi, cataVehiculo.Text);//DBFunctions.SingleData("SELECT pcat_codigo FROM mvehiculo mv, mCATALOGOVEHICULO MC WHERE pcat_codigo='" + catalogo + "' AND MV.mcat_vin='" + vin + "' AND MC.MCAT_VIN = MV.MCat_VIN"));
            DatasToControls.EstablecerDefectoDropDownList(estadoVehiculo, DBFunctions.SingleData("SELECT test_nombesta FROM testadovehiculo WHERE test_tipoesta=(SELECT test_tipoesta FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + ")"));
            DatasToControls.EstablecerDefectoDropDownList(ubicacion, DBFunctions.SingleData("SELECT pubi_nombre FROM pubicacion WHERE pubi_codigo='" + DBFunctions.SingleData("SELECT pubi_codigo FROM mubicacionvehiculo WHERE pcat_codigo='" + catalogo + "' AND mcat_vin='" + vin + "' ORDER BY mubi_codigo DESC") + "'"));
            DatasToControls.EstablecerDefectoDropDownList(tipoCompra, DBFunctions.SingleData("SELECT tcom_tipocompra FROM tcompravehiculo WHERE tcom_codigo=(SELECT tcom_codigo FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + ")"));
            DatasToControls.EstablecerDefectoDropDownList(tipoVehiculo, DBFunctions.SingleData("SELECT tcla_nombre FROM tclasevehiculo WHERE tcla_clase=(SELECT tcla_codigo FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + ")"));
            if (tipoVehiculo.SelectedValue.ToString() == "U")
            {
                lblPrecioPublico.Text    = "Precio de Venta a Público";
                txtPrecioPublico.Enabled = true;
            }
            else
            {
                lblPrecioPublico.Text    = "";
                txtPrecioPublico.Enabled = false;
            }
            txtPrecioPublico.Text     = ds.Tables[0].Rows[0]["mveh_valoinfl"].ToString();
            numeRecepcion.Text        = ds.Tables[0].Rows[0]["mveh_numerece"].ToString();
            fechRecepcion.Text        = Convert.ToDateTime(ds.Tables[0].Rows[0]["mveh_fechrece"].ToString()).GetDateTimeFormats()[5];
            fechDisponible.Text       = Convert.ToDateTime(ds.Tables[0].Rows[0]["mveh_fechdisp"].ToString()).GetDateTimeFormats()[5];
            kiloRecepcion.Text        = ds.Tables[0].Rows[0]["mveh_kilometr"].ToString();
            numeManifiesto.Text       = ds.Tables[0].Rows[0]["mveh_numemani"].ToString();
            fechManifiesto.Text       = Convert.ToDateTime(ds.Tables[0].Rows[0]["mveh_fechmani"].ToString()).GetDateTimeFormats()[5];
            numeAduana.Text           = ds.Tables[0].Rows[0]["mveh_aduana"].ToString();
            numeDO.Text               = ds.Tables[0].Rows[0]["mveh_numed_o"].ToString();
            numeLevante.Text          = ds.Tables[0].Rows[0]["mveh_numelevante"].ToString();
            valorGastos.Text          = ds.Tables[0].Rows[0]["mveh_valogast"].ToString();
            nitPropietario.Text       = ds.Tables[0].Rows[0]["mnit_nit"].ToString();
            txtPlaca.Text             = DBFunctions.SingleData("SELECT MCAT_PLACA FROM MCATALOGOVEHICULO WHERE MCAT_VIN = '" + vin + "'");
            txtFechaMatriInicial.Text = Convert.ToDateTime(DBFunctions.SingleData("SELECT MCAT_VENTA FROM MCATALOGOVEHICULO WHERE MCAT_VIN = '" + vin + "'")).GetDateTimeFormats()[5];
            //txtNumMatriInicial.Text = ;
            try
            {
                fechEntrega.Text = ds.Tables[0].Rows[0]["mveh_fechentr"].ToString();
            }
            catch {
                Utils.MostrarAlerta(Response, "Este vehículo tiene asignada una fecha de entrega");
            }

            /*
             *          numeInventario.Text = DBFunctions.SingleData("SELECT max(mveh_inventario) FROM mvehiculo WHERE mcat_vin='"+vin+"'");
             *          prefPedido.Text     = DBFunctions.SingleData("SELECT pdoc_nombre FROM pdocumento WHERE pdoc_codigo=(SELECT pdoc_codigopediprov FROM mvehiculo WHERE mcat_vin='"+vin+"')");
             *          numePedido.Text     = DBFunctions.SingleData("SELECT mped_numero FROM mvehiculo WHERE mcat_vin='"+vin+"'");
             * DatasToControls.EstablecerDefectoDropDownList(ddlCataVehi, DBFunctions.SingleData("SELECT pcat_codigo FROM mvehiculo mv, mCATALOGOVEHICULO MC WHERE pcat_codigo='" + catalogo + "' AND MV.mcat_vin='" + vin + "' AND MC.MCAT_VIN = MV.MCat_VIN"));
             * DatasToControls.EstablecerDefectoDropDownList(estadoVehiculo, DBFunctions.SingleData("SELECT test_nombesta FROM testadovehiculo WHERE test_tipoesta=(SELECT test_tipoesta FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + ")"));
             *          DatasToControls.EstablecerDefectoDropDownList(ubicacion,DBFunctions.SingleData("SELECT pubi_nombre FROM pubicacion WHERE pubi_codigo='"+DBFunctions.SingleData("SELECT pubi_codigo FROM mubicacionvehiculo WHERE pcat_codigo='"+catalogo+"' AND mcat_vin='"+vin+"' ORDER BY mubi_codigo DESC")+"'"));
             * DatasToControls.EstablecerDefectoDropDownList(tipoCompra, DBFunctions.SingleData("SELECT tcom_tipocompra FROM tcompravehiculo WHERE tcom_codigo=(SELECT tcom_codigo FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + ")"));
             * DatasToControls.EstablecerDefectoDropDownList(tipoVehiculo, DBFunctions.SingleData("SELECT tcla_nombre FROM tclasevehiculo WHERE tcla_clase=(SELECT tcla_codigo FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text + ")"));
             * if (tipoVehiculo.SelectedValue.ToString() == "U")
             * {
             *  lblPrecioPublico.Text = "Precio de Venta a Público";
             *  txtPrecioPublico.Enabled = true;
             * }
             * else
             * {
             *  lblPrecioPublico.Text = "";
             *  txtPrecioPublico.Enabled = false;
             * }
             * txtPrecioPublico.Text = DBFunctions.SingleData("SELECT mveh_valoinfl FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * numeRecepcion.Text  = DBFunctions.SingleData("SELECT mveh_numerece FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * fechRecepcion.Text  = System.Convert.ToDateTime(DBFunctions.SingleData("SELECT mveh_fechrece FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text)).ToString("yyyy-MM-dd");
             * fechDisponible.Text = System.Convert.ToDateTime(DBFunctions.SingleData("SELECT mveh_fechdisp FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text)).ToString("yyyy-MM-dd");
             * kiloRecepcion.Text  = DBFunctions.SingleData("SELECT mveh_kilometr FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * numeManifiesto.Text = DBFunctions.SingleData("SELECT mveh_numemani FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * fechManifiesto.Text = System.Convert.ToDateTime(DBFunctions.SingleData("SELECT mveh_fechmani FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text)).ToString("yyyy-MM-dd");
             * numeAduana.Text     = DBFunctions.SingleData("SELECT mveh_aduana FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * numeDO.Text         = DBFunctions.SingleData("SELECT mveh_numed_o FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * numeLevante.Text    = DBFunctions.SingleData("SELECT mveh_numelevante FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * valorGastos.Text    = DBFunctions.SingleData("SELECT mveh_valogast FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             * nitPropietario.Text = DBFunctions.SingleData("SELECT mnit_nit FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text);
             *          try
             *          {
             *  fechEntrega.Text = System.Convert.ToDateTime(DBFunctions.SingleData("SELECT mveh_fechentr FROM mvehiculo WHERE mveh_inventario=" + numeInventario.Text)).ToString("yyyy-MM-dd");
             *          }
             *          catch{}
             */
        }