Exemplo n.º 1
0
        private void ControlarSolicitudesMatricula(int id, int tipoInforme, int tipoPropiedad, int idProvincia, string leg, string folio, string tomo, string ano)
        {
            // Si no están anotadas las solicitudes anteriores...
            //if (txtInformesAnteriores.Text.StartsWith("MATRICULA SOLICITADA ANTERIORMENTE:") == false)
            if (txtInformesAnteriores.Text == "")
            {
                // Busco las solicitudes anteriores de la matrícula...
                int idInforme = id;

                string legajo  = leg;
                string mensaje = "";//"MATRICULA SOLICITADA ANTERIORMENTE: \r";

                // Si el informe tiene nºro de matrícula
                DataTable solicitudes = null;
                switch (tipoPropiedad)
                {
                case 1: solicitudes = ControlMatriculasDal.ControlarMatricula(idInforme, tipoInforme, tipoPropiedad, idProvincia, legajo);
                    break;

                case 2: solicitudes = ControlMatriculasDal.ControlarMatricula(idInforme, tipoInforme, tipoPropiedad, idProvincia, legajo, tomo, folio, ano);
                    break;

                case 3: solicitudes = ControlMatriculasDal.ControlarMatricula(idInforme, tipoInforme, tipoPropiedad, idProvincia, legajo, tomo, folio, ano);
                    break;
                }
                if (solicitudes != null && solicitudes.Rows.Count != 0)
                {
                    int idCliente = -1;
                    mensaje += "CONSULTADO ANTERIORMENTE POR: ";
                    foreach (DataRow solicitud in solicitudes.Rows)
                    {
                        bool cambio = false;
                        if (idCliente == -1)
                        {
                            mensaje  += solicitud[1].ToString() + ", ";
                            idCliente = int.Parse(solicitud[2].ToString());
                            cambio    = true;
                        }
                        if (idCliente != int.Parse(solicitud[2].ToString()))
                        {
                            //mensaje += "\r";
                            mensaje  += " - ";
                            mensaje  += solicitud[1].ToString() + ", ";
                            idCliente = int.Parse(solicitud[2].ToString());
                            cambio    = true;
                        }
                        if (!cambio)
                        {
                            mensaje += ", ";
                        }
                        mensaje += (solicitud[0].ToString()).Substring(0, 10);
                    }
                    txtInformesAnteriores.Text = mensaje += "\r" + txtInformesAnteriores.Text;
                }
            }
            txtInformesAnteriores.Text = esVacio(txtInformesAnteriores.Text);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int    intId;
                int    intTipo        = 1;
                int    intTipoInforme = 1;
                int    intIdProvincia = 2;
                string strLegajo      = "";
                string strFolio       = "";
                string strAno         = "";
                string strTomo        = "";
                try
                {
                    intId          = int.Parse(Request.QueryString["Id"]);
                    intTipo        = int.Parse(Request.QueryString["Tipo"]);
                    intTipoInforme = int.Parse(Request.QueryString["tipoInforme"]);
                    intIdProvincia = int.Parse(Request.QueryString["idProvincia"]);

                    strLegajo = Request.QueryString["Legajo"];
                    if (intTipo == 2 || intTipo == 3)
                    {
                        strFolio = Request.QueryString["Folio"];
                        strAno   = Request.QueryString["Ano"];
                        strTomo  = Request.QueryString["Tomo"];
                        dgMatriculas.DataSource = ControlMatriculasDal.ControlarMatricula(intId, intTipoInforme, intTipo, intIdProvincia, strLegajo, strTomo, strFolio, strAno);
                        txtTipo.Text            = "Matricula, Folio y Año ";
                    }
                    else
                    {
                        dgMatriculas.DataSource = ControlMatriculasDal.ControlarMatricula(intId, intTipoInforme, intTipo, intIdProvincia, strLegajo);
                        txtTipo.Text            = "Matricula ";
                    }
                    dgMatriculas.DataBind();
                    if (dgMatriculas.Items.Count == 0)
                    {
                        btnCerrar_Click(null, null);
                    }
                    else
                    {
                        if (intTipo == 2 || intTipo == 3)
                        {
                            lblFiltro.Text = "Matricula: " + strLegajo + ", Folio: " + strFolio + ", Año: " + strAno;
                        }
                        else
                        {
                            lblFiltro.Text = "Matricula: " + strLegajo;
                        }
                    }
                }
                catch
                {
                    //btnCerrar_Click(null, null);
                }
            }
        }
Exemplo n.º 3
0
    public string verificarInformeExistente(string valor)
    {
        //valor = ("cmbClientes") + "|" + ("cmbTipoInforme") + "|" + ("cmbTipoPropiedad") + "|" + ("txtLegajo");
        //valor = valor + "|" + ("cmbProvinciaOtra");

        //valor = ("cmbClientes") + "|" + ("cmbTipoInforme") + "|" + ("cmbTipoPropiedad") + "|" + ("txtFolio") + "|" + ("txtAno");
        //valor = valor + "|" + ("cmbProvinciaOtra");


        char[] separadores = new char[] { '|' };
        //string[] arrValor;
        //= valor.Split("|");
        string Matricula = "";
        string Folio     = "";
        string Ano       = "";
        string nombre    = "";

        string[] arreglo       = valor.Split(separadores);
        int      idCliente     = int.Parse(arreglo[0]);
        int      tipoInforme   = int.Parse(arreglo[1]);
        int      tipoPropiedad = int.Parse(arreglo[2]);
        int      idProvincia   = 2;

        if (tipoPropiedad == 1 || tipoPropiedad == 4)
        {
            Matricula = arreglo[3];
        }

        if (tipoPropiedad == 2)
        {
            Folio = arreglo[3];
            Ano   = arreglo[4];
        }

        if (tipoPropiedad == 3)
        {
            Matricula = arreglo[3];
            Folio     = arreglo[4];
        }

        if (tipoInforme == 11)
        {
            if (tipoPropiedad == 1 || tipoPropiedad == 4)
            {
                idProvincia = int.Parse(arreglo[4]);
            }

            if (tipoPropiedad == 2 || tipoPropiedad == 3)
            {
                idProvincia = int.Parse(arreglo[5]);
            }
        }

        DataTable MyBase = ControlMatriculasDal.ControlarMatriculaSolicitadaExistente(0, idCliente, tipoInforme, tipoPropiedad, idProvincia, Matricula, Folio, Ano);

        if (MyBase.Rows.Count > 0)
        {
            for (int j = 0; j < MyBase.Rows.Count; j++)
            {
                if (j > 0)
                {
                    nombre = nombre + "|";
                }
                nombre = nombre + MyBase.Rows[j]["idEncabezado"].ToString().Trim() + "," + MyBase.Rows[j]["fecha"].ToString().Trim() + "," + MyBase.Rows[j]["usuariocliente"].ToString().Trim() + "," + MyBase.Rows[j]["nombreestado"].ToString().Trim();
            }
        }

        string valorFinal = nombre;// +"," + cuit + "," + tmpDNI;

        return(valorFinal);
    }