Exemplo n.º 1
0
        public VehiculoBEList GETListarBuscarCliente(VehiculoBE ent)
        {
            VehiculoBEList lista   = new VehiculoBEList();
            IDataReader    DReader = null;

            try
            {
                using (Database db = new Database())
                {
                    db.ProcedureName = "[SRC_SPS_SEL_CLIENTE_x_VEHICULO]";
                    db.AddParameter("@vi_co_tipo_cliente", DbType.String, ParameterDirection.Input, ent.DET_co_tipo_cliente);
                    db.AddParameter("@vi_co_tipo_documento", DbType.String, ParameterDirection.Input, ent.DET_co_tipo_documento);
                    db.AddParameter("@vi_nu_documento", DbType.String, ParameterDirection.Input, ent.DET_nu_documento);
                    DReader = db.GetDataReader();
                }
                while (DReader.Read())
                {
                    VehiculoBE oBE = CrearEntidad_BusCliente(DReader);
                    lista.Add(oBE);
                }

                DReader.Close();
            }
            catch (Exception)
            {
                if (DReader != null && !DReader.IsClosed)
                {
                    DReader.Close();
                }
                throw;
            }
            return(lista);
        }
Exemplo n.º 2
0
    public static object Get_Inicial(String nid_cliente)
    {
        #region "- Carga Placa por Cliente"
        ArrayList     oDatosVehiculo = new ArrayList();
        List <object> oComboPlaca    = new List <object>();

        VehiculoBL oVehiculoBL = new VehiculoBL();
        ClienteBE  param       = new ClienteBE();
        param.nid_cliente = Convert.ToInt32(nid_cliente);
        VehiculoBEList listaVehiculo = oVehiculoBL.ListarVehiculoPorCliente(param);
        if (listaVehiculo != null && listaVehiculo.Count > 0)
        {
            foreach (VehiculoBE item in listaVehiculo)
            {
                oComboPlaca.Add(new
                {
                    value  = item.nu_placa,
                    nombre = item.nu_placa
                });
            }
        }

        #endregion

        object response = new
        {
            oComboPlaca = oComboPlaca
        };
        System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
        return(serializer.Serialize(response));
    }
    public static object Get_Modelo(String[] strParametros)
    {
        ArrayList  oComboModelo = null;
        VehiculoBL oVehiculoBL  = new VehiculoBL();
        VehiculoBE oVehiculoBE  = new VehiculoBE();

        oVehiculoBE.nid_marca = Convert.ToInt32(strParametros[0]);

        VehiculoBEList oModelos = oVehiculoBL.ListarModelosPorMarca(oVehiculoBE);

        if (oModelos != null)
        {
            oComboModelo = new ArrayList();
            foreach (VehiculoBE oModelo in oModelos)
            {
                object objModelo = new { value = oModelo.nid_modelo.ToString(), nombre = oModelo.no_modelo };
                oComboModelo.Add(objModelo);
            }
        }

        object response = new
        {
            oComboModelo
        };

        System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
        return(serializer.Serialize(response));
    }
Exemplo n.º 4
0
        public VehiculoBEList ListarDatosPorPlaca(VehiculoBE ent)
        {
            VehiculoBEList lista  = new VehiculoBEList();
            SqlConnection  conn   = new SqlConnection(DataBaseHelper.GetDbConnectionString());
            SqlCommand     cmd    = new SqlCommand("[SRC_SPS_DATOSVEHICULO_POR_PLACA_FO]", conn);
            SqlDataReader  reader = null;

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@vi_nu_placa", ent.nu_placa);
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    lista.Add(Entidad_ListarDatosPorPlaca(reader));
                }
                reader.Close();
            }
            catch (Exception)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(lista);
        }
Exemplo n.º 5
0
        public VehiculoBEList ListarMarcas()
        {
            VehiculoBEList lista  = new VehiculoBEList();
            SqlConnection  conn   = new SqlConnection(DataBaseHelper.GetDbConnectionString());
            SqlCommand     cmd    = new SqlCommand("SRC_SPS_MARCAS_FO", conn);
            SqlDataReader  reader = null;

            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    lista.Add(Entidad_ListarMarcas(reader));
                }
                reader.Close();
            }
            catch (Exception)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(lista);
        }
Exemplo n.º 6
0
        public VehiculoBEList ListarVehiculoPorCliente(ClienteBE ent)
        {
            VehiculoBEList lista  = new VehiculoBEList();
            SqlConnection  conn   = new SqlConnection(DataBaseHelper.GetDbConnectionString());
            SqlCommand     cmd    = new SqlCommand("src_sps_vehiculo_por_cliente_web", conn);
            SqlDataReader  reader = null;

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@vi_nid_cliente", ent.nid_cliente);
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    lista.Add(Entidad_ListarVehiculoPorCliente(reader));
                }
                reader.Close();
            }
            catch (Exception)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(lista);
        }
    public static object Get_Inicial()
    {
        #region "Obtiene Tipo Documento"
        ComboBL       oComboBL          = new ComboBL();
        List <object> oComboTipoPersona = new List <object>();
        ComboBEList   listaTipoPersona  = oComboBL.Get_Combo("TIPO_PERSONA", "");
        if (listaTipoPersona != null)
        {
            foreach (ComboBE oTD in listaTipoPersona)
            {
                oComboTipoPersona.Add(new { value = oTD.value.Trim(), oTD.nombre });
            }
        }
        #endregion

        #region "Obtiene Tipo Documento"
        ClienteBL     oClienteBL          = new ClienteBL();
        List <object> oComboTipoDocumento = new List <object>();
        ClienteBEList oClienteBEList      = oClienteBL.ListarTipoDocumentos();
        if (oClienteBEList != null)
        {
            foreach (ClienteBE oTD in oClienteBEList)
            {
                oComboTipoDocumento.Add(new { value = oTD.cod_tipo_documento.Trim(), nombre = oTD.des_tipo_documento });
            }
        }
        #endregion "Obtiene Tipo Documento"

        #region "Obtiene Marcas"
        VehiculoBL     oVehiculoBL = new VehiculoBL();
        ArrayList      oComboMarca = new ArrayList();
        VehiculoBEList oMarcas     = oVehiculoBL.ListarMarcas();

        foreach (VehiculoBE oMarca in oMarcas)
        {
            object objMarca;
            objMarca = new { value = oMarca.nid_marca.ToString(), nombre = oMarca.no_marca };
            oComboMarca.Add(objMarca);
        }
        #endregion "Obtiene Marcas"

        object response = new
        {
            oComboTipoPersona,
            oComboTipoDocumento,
            oComboMarca
        };

        System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
        return(serializer.Serialize(response));
    }
Exemplo n.º 8
0
    protected void btnExcel_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            MaestroVehiculoBL oMaestroVehiculoBL = new MaestroVehiculoBL();
            oMaestroVehiculoBL.ErrorEvent += new MaestroVehiculoBL.ErrorDelegate(Master.Transaction_ErrorEvent);

            objEnt.nu_placa     = txt_busplacapatente.Text.Trim();
            objEnt.nu_vin       = txt_busnrovin.Text.Trim();
            objEnt.nid_marca    = int.Parse(ddl_busmarca.SelectedValue.ToString());
            objEnt.nid_modelo   = int.Parse(ddl_busmodelo.SelectedValue.ToString());
            objEnt.qt_km_actual = Int64.Parse((txt_buskilometraje.Text.Length == 0 ? "-1" : txt_buskilometraje.Text.Trim()));
            objEnt.fl_activo    = cboEstado.SelectedValue.ToString();

            this.oMaestroVehiculoBEList = oMaestroVehiculoBL.GETListarVehiculos(objEnt, Profile.Usuario.Nid_usuario);

            const string RUTA_DOCUMENTOS = ConstanteBE.RUTA_MANTENIMIENTO_SRC;
            String       carpeta = String.Empty, nombre = String.Empty, RutaFinal = String.Empty;
            String       ruta = Convert.ToString(ConfigurationManager.AppSettings["FileServerPath"]) + RUTA_DOCUMENTOS;
            ruta = Utility.CrearCarpetaFileServer(ruta);

            String           fl_Ruta           = ConstanteBE.FLAT_EXCEL_SRC;
            ExportarExcelXml oExportarExcelXml = new ExportarExcelXml();
            String           archivo           = oExportarExcelXml.GenerarExcelExportarVehiculo(this.oMaestroVehiculoBEList, ruta);

            if (!archivo.Equals("-1"))
            {
                nombre  = archivo;
                carpeta = Utility.ObtenerCarpetaFileServer(nombre);
                archivo = Convert.ToString(ConfigurationManager.AppSettings["FileServerPath"]) + RUTA_DOCUMENTOS + carpeta + @"\" + Convert.ToString(nombre.Trim());
                if (File.Exists(archivo))
                {
                    this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), String.Empty, "<script> window.open('../SGS_Comunes/SGS_VerExcelExpotable.aspx?nombreArchivo=" + nombre + "&flatRuta=" + fl_Ruta + "')</script>");
                }
            }
            else
            {
                JavaScriptHelper.Alert(this, "'Problemas al generar el excel, consulte con el administrador.'", String.Empty);
            }
        }
        catch (Exception ex)
        {
            Master.Web_ErrorEvent(this, ex);
            JavaScriptHelper.Alert(this, ex.Message.ToString(), String.Empty);
        }
    }
Exemplo n.º 9
0
    private void CargarEntidad()
    {
        VehiculoBEList objBEList = new VehiculoBEList();

        objBEList = (VehiculoBEList)(Session["VehiculoBEList"]);
        if (objBEList != null)
        {
            for (int i = 0; i < objBEList.Count; i++)
            {
                if (objBEList[i].nid_vehiculo.ToString().Trim().Equals(Session["txh_nid_vehiculo"].ToString().Trim()))
                {
                    objEnt = objBEList[i];
                }
            }
        }
        else
        {
            Response.Redirect("SRC_Maestro_Vehiculo.aspx");
        }
    }
Exemplo n.º 10
0
    protected void btnBuscarWarrant_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            hf_exportaexcel.Value  = "";
            txh_nid_vehiculo.Value = String.Empty;
            objEnt.nu_placa        = txt_busplacapatente.Text.Trim();
            objEnt.nu_vin          = txt_busnrovin.Text.Trim();
            objEnt.nid_marca       = int.Parse(ddl_busmarca.SelectedValue.ToString());
            objEnt.nid_modelo      = int.Parse(ddl_busmodelo.SelectedValue.ToString());
            objEnt.qt_km_actual    = Int64.Parse((txt_buskilometraje.Text.Length == 0 ? "-1" : txt_buskilometraje.Text.Trim()));
            objEnt.fl_activo       = cboEstado.SelectedValue.ToString();

            Session["MaestroVehiculoBE_FILTRO"] = objEnt;
            Session["bus_objEnt"] = objEnt;

            //---------
            this.oMaestroVehiculoBEList = objNeg.GETListarVehiculos(objEnt, Profile.Usuario.Nid_usuario);

            if (oMaestroVehiculoBEList == null || oMaestroVehiculoBEList.Count == 0)
            {
                Session["MaestroVehiculoBE_FILTRO"] = null;
                objEnt = null;
                objEnt = new VehiculoBE();
                oMaestroVehiculoBEList.Add(objEnt);
            }
            else
            {
                hf_exportaexcel.Value = "1";
            }

            this.gdVehiculos.DataSource = oMaestroVehiculoBEList;
            this.gdVehiculos.DataBind();

            Session["VehiculoBEList"] = oMaestroVehiculoBEList;
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 11
0
        public VehiculoBEList GETListarVehiculos(VehiculoBE ent, Int32 Nid_usuario)
        {
            VehiculoBEList lista   = new VehiculoBEList();
            IDataReader    DReader = null;

            try
            {
                using (Database db = new Database())
                {
                    db.ProcedureName = "[SRC_SPS_SEL_VEHICULO]";
                    db.AddParameter("@nu_placa", DbType.String, ParameterDirection.Input, ent.nu_placa);
                    db.AddParameter("@nu_vin", DbType.String, ParameterDirection.Input, ent.nu_vin);
                    db.AddParameter("@nid_marca", DbType.Int32, ParameterDirection.Input, ent.nid_marca);
                    db.AddParameter("@nid_modelo", DbType.Int32, ParameterDirection.Input, ent.nid_modelo);
                    db.AddParameter("@qt_km_actual", DbType.Int64, ParameterDirection.Input, ent.qt_km_actual);
                    db.AddParameter("@Estado", DbType.String, ParameterDirection.Input, ent.fl_activo);
                    db.AddParameter("@Nid_usuario", DbType.Int32, ParameterDirection.Input, Nid_usuario);
                    DReader = db.GetDataReader();
                }
                while (DReader.Read())
                {
                    VehiculoBE oBE = CrearEntidad_Parametros(DReader);
                    lista.Add(oBE);
                }

                DReader.Close();
            }
            catch //(Exception Ex)
            {
                if (DReader != null && !DReader.IsClosed)
                {
                    DReader.Close();
                }
                throw;
            }
            return(lista);
        }
Exemplo n.º 12
0
    protected void gdVehiculos_Sorting(object sender, GridViewSortEventArgs e)
    {
        VehiculoBEList oMaestroVehiculoBEList = (VehiculoBEList)(Session["VehiculoBEList"]);
        SortDirection  indOrden = (SortDirection)(Session["ordenGridTalleres"]);

        txh_nid_vehiculo.Value = String.Empty;

        if (oMaestroVehiculoBEList != null)
        {
            if (indOrden == SortDirection.Ascending)
            {
                oMaestroVehiculoBEList.Ordenar(e.SortExpression, direccionOrden.Descending);
                Session["ordenGridTalleres"] = SortDirection.Descending;
            }
            else
            {
                oMaestroVehiculoBEList.Ordenar(e.SortExpression, direccionOrden.Ascending);
                Session["ordenGridTalleres"] = SortDirection.Ascending;
            }
        }
        gdVehiculos.DataSource = oMaestroVehiculoBEList;
        gdVehiculos.DataBind();
        Session["VehiculoBEList"] = oMaestroVehiculoBEList;
    }
Exemplo n.º 13
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        //Bandeja de perfiles
        VehiculoBEList oMaestroVehiculoBEList = (VehiculoBEList)(Session["VehiculoBEList"]);

        if (oMaestroVehiculoBEList != null &&
            this.gdVehiculos != null &&
            this.gdVehiculos.Rows.Count > 0 &&
            this.gdVehiculos.PageCount > 1)
        {
            GridViewRow oRow = this.gdVehiculos.BottomPagerRow;
            if (oRow != null)
            {
                Label oTotalReg = new Label();
                oTotalReg.Text = String.Format("Total Reg. {0}", (oMaestroVehiculoBEList.Count));

                oRow.Cells[0].Controls.AddAt(0, oTotalReg);

                Table oTablaPaginacion = (Table)oRow.Cells[0].Controls[1];
                oTablaPaginacion.CellPadding = 0;
                oTablaPaginacion.CellSpacing = 0;
            }
        }
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Acceso a Pagina
        string AccesoPagina = (Master as Principal).ValidaAccesoOpcion(ConstanteBE.SRC_MantVehiculo_AccionVerForm);

        if (string.IsNullOrEmpty(AccesoPagina))
        {
            AccesoPagina = (Master as Principal).ValidaTipoAccesoPagina(Page, "SinAcceso");
        }

        btnVerDet.Visible = OpcionVer();
        btnNuevo.Visible  = OpcionNuevo();
        BtnEditar.Visible = OpcionEditar();


        lblTextoPlaca.Text = oParm.N_Placa.ToString();
        gdVehiculos.Columns[0].HeaderText = oParm.N_Placa.ToString();

        if (!Page.IsPostBack)
        {
            Session["ordenGridTalleres"] = SortDirection.Descending;
            Inicializa();


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

            //INICIALIZANDO EL GRIDVIEW
            this.oMaestroVehiculoBEList = new VehiculoBEList();
            this.oMaestroVehiculoBEList.Add(new VehiculoBE());
            Session["VehiculoBEList"]   = oMaestroVehiculoBEList;
            this.gdVehiculos.DataSource = this.oMaestroVehiculoBEList;
            this.gdVehiculos.DataBind();

            //Solo mostrar en Chile [Anio-Tipo]
            this.gdVehiculos.Columns[5].Visible = oParm.SRC_CodPais.Equals("2");
            this.gdVehiculos.Columns[6].Visible = oParm.SRC_CodPais.Equals("2");


            if (Session["MaestroVehiculoBE_FILTRO"] != null)
            {
                objEnt = new VehiculoBE();
                VehiculoBE objFiltro = new VehiculoBE();
                objFiltro = (VehiculoBE)(Session["MaestroVehiculoBE_FILTRO"]);
                txt_busplacapatente.Text   = objFiltro.nu_placa.Trim();
                txt_busnrovin.Text         = objFiltro.nu_vin.Trim();
                ddl_busmarca.SelectedValue = objFiltro.nid_marca.ToString();
                objEnt.nid_marca           = int.Parse(ddl_busmarca.SelectedValue.ToString().Trim());
                CargarModelos(objEnt);
                if (ddl_busmodelo.Items.Count == 0)
                {
                    ddl_busmodelo.Items.Insert(0, new ListItem("--No Tiene--", "--No Tiene--"));
                }
                ddl_busmodelo.SelectedValue = objFiltro.nid_modelo.ToString();
                if (objFiltro.qt_km_actual.ToString().Trim().Length == 0)
                {
                    txt_buskilometraje.Text = "";
                }
                else
                {
                    if (objFiltro.qt_km_actual.ToString().Trim() == "0")
                    {
                        txt_buskilometraje.Text = "";
                    }
                    else if (objFiltro.qt_km_actual.ToString().Trim() == "-1")
                    {
                        txt_buskilometraje.Text = "";
                    }
                    else
                    {
                        txt_buskilometraje.Text = objFiltro.qt_km_actual.ToString().Trim();
                    }
                }
                cboEstado.SelectedValue = objFiltro.fl_activo.ToString();
                btnBuscarWarrant_Click(null, null);
            }
        }
    }
Exemplo n.º 15
0
    public void Metodo_Buscar_Contacto()
    {
        objEnt.DET_co_tipo_cliente   = ddl_cont_tipopersona.SelectedValue.ToString().Trim();
        objEnt.DET_co_tipo_documento = ddl_cont_tipodoc.SelectedValue.ToString().Trim();
        objEnt.DET_nu_documento      = txt_cont_nro_doc.Text.Trim();

        VehiculoBEList ObjLista = new VehiculoBEList();

        ObjLista = objNeg.GETListarBuscarCliente(objEnt);

        if (ObjLista.Count > 0)
        {
            string   cadena    = ObjLista[0].DET_NOMBRES_RZ;
            string[] nombre_rz = new string[3];
            nombre_rz = cadena.Split('*');
            if (nombre_rz.Length == 1)
            {
                txt_cont_nom_rz.Text = nombre_rz.GetValue(0).ToString();
            }
            else
            {
                txt_cont_nom_rz.Text     = nombre_rz.GetValue(0).ToString();
                txt_cont_apepaterno.Text = nombre_rz.GetValue(1).ToString();
                txt_cont_apematerno.Text = nombre_rz.GetValue(2).ToString();
            }

            txt_cont_telefono.Text             = ObjLista[0].DET_nu_telefono.ToString();
            txt_cont_telefono2.Text            = ObjLista[0].DET_nu_telefono2.ToString();
            txt_cont_celular.Text              = ObjLista[0].DET_nu_celular.ToString();
            txt_cont_celular2.Text             = ObjLista[0].DET_nu_celular2.ToString();
            txt_cont_email.Text                = ObjLista[0].DET_no_correo.ToString();
            txt_cont_email_trab.Text           = ObjLista[0].DET_no_correo_trab.ToString();
            txt_cont_email_alter.Text          = ObjLista[0].DET_no_correo_alter.ToString();
            hid_nid_contacto.Value             = ObjLista[0].DET_cod_cliente.ToString();
            tabMantMaesVehiculo.ActiveTabIndex = 1;

            int       nid_contacto     = int.Parse(hid_nid_contacto.Value);
            ClienteBE oMestroClienteBE = ClienteBL.ListarDatosClienteDireccion(nid_contacto);
            txhIDDireccion.Value = "0";
            if (!oMestroClienteBE.nid_cliente.Equals(0))
            {
                txhIDDireccion.Value       = oMestroClienteBE.nid_cliente_direccion.ToString();
                ddl_cont_dep.SelectedValue = oMestroClienteBE.coddpto;
                ddl_cont_dep_SelectedIndexChanged(this, null);
                ddl_cont_prov.SelectedValue = oMestroClienteBE.codprov;
                ddl_cont_prov_SelectedIndexChanged(this, null);
                ddl_cont_dist.SelectedValue = oMestroClienteBE.coddist;
                txt_cont_dir.Text           = oMestroClienteBE.no_direccion.Trim();
                txt_cont_fax.Text           = oMestroClienteBE.nu_fax.Trim();
                bool flAcceso = (Master as Principal).ValidaAccesoOpcion(ConstanteBE.SRC_MantCliente_AccionEditarDireccion).Equals(CONSTANTE_SEGURIDAD.AccesoEdicion) && oParm.SRC_Pais.Equals(1);
                ddl_cont_dep.Enabled = ddl_cont_prov.Enabled = ddl_cont_dist.Enabled = txt_cont_dir.Enabled = txt_cont_fax.Enabled = flAcceso;
            }
            if (ObjLista[0].fl_identidad_validada.Equals(1))
            {
                trContacto_Mensaje.Visible  = true;
                txt_cont_nom_rz.Enabled     = false;
                txt_cont_apepaterno.Enabled = false;
                txt_cont_apematerno.Enabled = false;
            }
            else
            {
                trContacto_Mensaje.Visible  = false;
                txt_cont_nom_rz.Enabled     = true;
                txt_cont_apepaterno.Enabled = true;
                txt_cont_apematerno.Enabled = true;
            }
        }
        else
        {
            trContacto_Mensaje.Visible  = false;
            txt_cont_nom_rz.Enabled     = true;
            txt_cont_apepaterno.Enabled = true;
            txt_cont_apematerno.Enabled = true;
            txt_cont_dir.Text           = "";
            txt_cont_fax.Text           = "";
            ddl_cont_dep.SelectedValue  = "0";
            ddl_cont_prov.Items.Clear();
            ddl_cont_prov.Items.Add(new ListItem("--Seleccione--", "0"));
            ddl_cont_dist.Items.Clear();
            ddl_cont_dist.Items.Add(new ListItem("--Seleccione--", "0"));
            hid_nid_contacto.Value    = "0";
            txt_cont_nom_rz.Text      = "";
            txt_cont_apepaterno.Text  = "";
            txt_cont_apematerno.Text  = "";
            txt_cont_telefono.Text    = "";
            txt_cont_telefono2.Text   = "";
            txt_cont_celular.Text     = "";
            txt_cont_celular2.Text    = "";
            txt_cont_email.Text       = "";
            txt_cont_email_trab.Text  = "";
            txt_cont_email_alter.Text = "";
        }
    }
Exemplo n.º 16
0
    public void Metodo_Buscar_Cliente()
    {
        objEnt.DET_co_tipo_cliente   = ddl_clie_tipopersona.SelectedValue.ToString().Trim();
        objEnt.DET_co_tipo_documento = ddl_clie_tipodoc.SelectedValue.ToString().Trim();
        objEnt.DET_nu_documento      = txt_clie_nro_doc.Text.Trim();

        VehiculoBEList ObjLista = new VehiculoBEList();

        ObjLista = objNeg.GETListarBuscarCliente(objEnt);

        if (ObjLista.Count > 0)
        {
            string   cadena    = ObjLista[0].DET_NOMBRES_RZ;
            string[] nombre_rz = new string[3];
            nombre_rz = cadena.Split('*');
            if (nombre_rz.Length == 1)
            {
                txt_clie_nom_rz.Text = nombre_rz.GetValue(0).ToString();
            }
            else
            {
                txt_clie_nom_rz.Text     = nombre_rz.GetValue(0).ToString();
                txt_clie_apepaterno.Text = nombre_rz.GetValue(1).ToString();
                txt_clie_apematerno.Text = nombre_rz.GetValue(2).ToString();
            }

            txt_clie_telefono.Text             = ObjLista[0].DET_nu_telefono.ToString();
            txt_clie_telefono2.Text            = ObjLista[0].DET_nu_telefono2.ToString();
            txt_clie_celular.Text              = ObjLista[0].DET_nu_celular.ToString();
            txt_clie_celular2.Text             = ObjLista[0].DET_nu_celular2.ToString();
            txtTelefonoFijo_Anexo.Text         = ObjLista[0].nu_anexo_telefono.ToString();
            hfPaisTelefonoCelular.Value        = ObjLista[0].nid_pais_celular.ToString();
            hfPaisTelefonoFijo.Value           = ObjLista[0].nid_pais_telefono.ToString();
            txt_clie_email.Text                = ObjLista[0].DET_no_correo.ToString();
            txt_clie_email_trab.Text           = ObjLista[0].DET_no_correo_trab.ToString();
            txt_clie_email_alter.Text          = ObjLista[0].DET_no_correo_alter.ToString();
            hid_nid_cliente.Value              = ObjLista[0].DET_cod_cliente.ToString();
            tabMantMaesVehiculo.ActiveTabIndex = 1;

            if (ObjLista[0].fl_identidad_validada.Equals(1))
            {
                trCliente_Mensaje.Visible   = true;
                txt_clie_nom_rz.Enabled     = false;
                txt_clie_apepaterno.Enabled = false;
                txt_clie_apematerno.Enabled = false;
            }
            else
            {
                trCliente_Mensaje.Visible   = false;
                txt_clie_nom_rz.Enabled     = true;
                txt_clie_apepaterno.Enabled = true;
                txt_clie_apematerno.Enabled = true;
            }
        }
        else
        {
            trCliente_Mensaje.Visible   = false;
            txt_clie_nom_rz.Enabled     = true;
            txt_clie_apepaterno.Enabled = true;
            txt_clie_apematerno.Enabled = true;
            hid_nid_cliente.Value       = "0";
            txt_clie_nom_rz.Text        = "";
            txt_clie_apepaterno.Text    = "";
            txt_clie_apematerno.Text    = "";
            txt_clie_telefono.Text      = "";
            txt_clie_telefono2.Text     = "";
            txt_clie_celular.Text       = "";
            txtTelefonoFijo_Anexo.Text  = "";
            hfPaisTelefonoCelular.Value = "";
            hfPaisTelefonoFijo.Value    = "";
            txt_clie_celular2.Text      = "";
            txt_clie_email.Text         = "";
            txt_clie_email_trab.Text    = "";
            txt_clie_email_alter.Text   = "";
        }
    }