Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Verificación de usuario
            Usuario currentUser = (Usuario)Session.Contents["usuario"];
            if (currentUser == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                if (currentUser.IdTipoUsuario != 5)
                {
                    switch (currentUser.IdTipoUsuario)
                    {
                    case 1:     //Administrador
                        Response.Redirect("Catalogos.aspx");
                        break;

                    case 2:    //Recepcion
                        Response.Redirect("Recepcion.aspx");
                        break;

                    case 3:    //Distribucion
                        Response.Redirect("Distribucion.aspx");
                        break;

                    case 4:    //Registrador
                        Response.Redirect("Registro.aspx");
                        break;

                    case 5:    //Verificación
                        Response.Redirect("Revision.aspx");
                        break;

                    case 6:    //Entrega
                        Response.Redirect("Entrega.aspx");
                        break;
                    }
                }
            }
            #endregion
            prelaciones              = new List <Prelacion>();
            prelacionElegida         = new Prelacion();
            prelaciones              = prelacionElegida.ObtenerPrelacionesEstatus("VERIFICACION");
            gvPrelaciones.DataSource = prelaciones;
            gvPrelaciones.DataBind();
            if (IsPostBack)
            {
                prelacionElegida = (Prelacion)HttpContext.Current.Session["prelacionElegida"];
                if (prelacionElegida != null)
                {
                    movimientos = new List <Movimientos>();
                    movimientos = Prelacion.ObtenerMovimientosPrelacion(prelacionElegida.IdPrelacion, "");
                }
            }
            if (!IsPostBack)
            {
                llenarDatosUsuario();
            }
        }
Exemplo n.º 2
0
        protected void btGuardarTramite_Click(object sender, EventArgs e)
        {
            //Prelacion pre = new Prelacion();
            String    total     = txTotal.Text.Replace("$", "");
            DataTable Temporal  = (DataTable)Session["tablaActos"];
            DataTable Temporal2 = (DataTable)Session["tablaAntecedentes"];

            if (!Temporal.Rows[0][0].ToString().Equals("") && !Temporal2.Rows[0][0].ToString().Equals(""))
            {
                Prelacion prelacioncompleta = armarPrelacion(total, Temporal, Temporal2);
                String    resultado         = Prelacion.GuardarPrelacionObjeto(prelacioncompleta);
                int       IdPrelacion       = 0;
                if (int.TryParse(resultado, out IdPrelacion))
                {
                    //Se crea un registro en CompendioDigitalizacion
                    CompendioDigitalizacion.CrearCompendio(prelacioncompleta);
                    //pasar a la sesion idPrelacion para obtenerlo en la boleta de impresion
                    Session["IDPRELACION"] = IdPrelacion.ToString();
                    limpiarFormulario();
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Prelación Agregada Correctamente')", true);
                    string url = "BoletaRecepcion.aspx";
                    string s   = "window.open('" + url + "', 'popup_window', 'width=750,height=800,left=100,top=100,resizable=no');";
                    ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Debes llenar al menos un Acto y/o Antecedente en tu Prelación')", true);
            }
        }
Exemplo n.º 3
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            Prelacion p = new Prelacion();

            p.NombreTitular     = txBNuevoTitular.Text;
            p.DescripcionBien   = txBDescripcion.Text;
            p.NumeroEscritura   = txBEscritura.Text;
            p.LugarOtorgamiento = txBLugarOtorgamiento.Text;
            p.TipoDocumento     = txBTipoDocumento.Text;
            p.FechaDocumento    = txBFechaOtorgamiento.Text;
            p.Folio             = txBFolio.Text;
            p.IdTramitante      = int.Parse(ddlBTramitante.SelectedValue.ToString());
            p.IdPrelacion       = (int)Session["bIdPrelacion"];
            p.Antecedentes      = new List <Antecedente>();
            p.Antecedentes      = (List <Antecedente>)Session["bAntecedentes"];

            Prelacion.ActualizarPrelacion(p);

            txBNuevoTitular.Text         = "";
            txBDescripcion.Text          = "";
            txBEscritura.Text            = "";
            txBLugarOtorgamiento.Text    = "";
            txBTipoDocumento.Text        = "";
            txBFechaOtorgamiento.Text    = "";
            txBFolio.Text                = "";
            ddlBTramitante.SelectedIndex = 0;
            Session["bIdPrelacion"]      = null;
            Session["bAntecedentes"]     = null;
            txBuscarPrelacion.Text       = "";
            gvBAntecedentes.DataSource   = null;
            gvBAntecedentes.DataBind();
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //obtener id_prelacion de la session
            //Session["IDPRELACION"] = Request.QueryString["IdPrelacion"];
            //Session["NOMBRE"] = "Esthela Vianey Vazquez Medina";
            int prelacionId = int.Parse(Request.QueryString["IdPrelacion"]);

            lbFecha.Text              = DateTime.Today.ToShortDateString();
            lbHora.Text               = DateTime.Now.ToShortTimeString();
            lbPrelacion.Text          = prelacionId.ToString();
            gvAntecedentes.DataSource = Prelacion.ObtenerAntecedentesPrelacion(prelacionId);
            gvAntecedentes.DataBind();
            Prelacion pre = Prelacion.PrelacionPorId(prelacionId);

            lbUsuario.Text     = "Usuario Actual";
            lbTramitante.Text  = pre.Tramitante;
            lbTitular.Text     = pre.NombreTitular;
            lbDescripcion.Text = pre.DescripcionBien;
            lbValorBase.Text   = pre.ValorInmueble.ToString();
            Tramitante tram = Tramitante.ObtenerTramitantePorId(pre.IdTramitante);

            lbRfc.Text        = tram.Rfc;
            lbDomicilio.Text  = tram.Calle + " " + tram.Numero + " " + tram.Colonia;
            lbDomicilio2.Text = tram.Municipio + " " + tram.Estado + " " + tram.CodigoPostal;

            gvServicios.DataSource = Prelacion.ObtenerMovimientosPrelacion(prelacionId, "");
            gvServicios.DataBind();
            lbTotal.Text   = pre.Total.ToString();
            lbNombreC.Text = Request.QueryString["Nombre"];
        }
Exemplo n.º 5
0
        protected void llenarCheckboxList(int idUsuario)
        {
            lbFolio.Text        = "";
            lbTitular.Text      = "";
            lbNumEscritura.Text = "";
            lbDescripcion.Text  = "";
            lbFecha.Text        = "";
            lbTramitante.Text   = "";
            lbMovimientos.Items.Clear();
            gvAntecedentes.DataSource = null;
            gvAntecedentes.DataBind();

            rbObservaciones.Items.Clear();
            rbSinRegistrar.Items.Clear();
            //Llenar el CheckBoxList de Prelaciones Sin Registrar
            foreach (Prelacion var in prelacion.ObtenerPrelacionesUsuario(idUsuario, "ASIGNADA"))
            {
                List <Movimientos> mov  = Prelacion.ObtenerMovimientosPrelacion(var.IdPrelacion, "");
                ListItem           item = new ListItem();
                item.Text  = var.IdPrelacion.ToString() + " | " + mov[0].Acto.Nombre;
                item.Value = var.IdPrelacion.ToString();
                rbSinRegistrar.Items.Add(item);
            }
            foreach (Prelacion var in prelacion.ObtenerPrelacionesUsuario(idUsuario, "REVISAR"))
            {
                List <Movimientos> mov  = Prelacion.ObtenerMovimientosPrelacion(var.IdPrelacion, "");
                ListItem           item = new ListItem();
                item.Text  = var.IdPrelacion.ToString() + " | " + mov[0].Acto.Nombre;
                item.Value = var.IdPrelacion.ToString();
                rbObservaciones.Items.Add(item);
            }
        }
Exemplo n.º 6
0
        protected void llenarListaMovimientos()
        {
            //Session["REGISTRO"] = "1";
            if (Session["IDPRELACION"] != null)
            {
                string[] datos = Session["IDPRELACION"].ToString().Split(';');
                if (datos.Length == 2)
                {
                    listamovimientos = Prelacion.ObtenerMovimientosPrelacion(int.Parse(datos[0]), "REVISION");
                }
                else
                {
                    listamovimientos = Prelacion.ObtenerMovimientosPrelacion(int.Parse(Session["IDPRELACION"].ToString()), "");
                }


                txIdPrelacion.Text = datos[0];
                radbMovimientos.Items.Clear();
                ddlSeccion.Items.Clear();
                ddlSeccion.Items.Add("Elige una Seccion");
                foreach (Movimientos var in listamovimientos)
                {
                    ListItem l = new ListItem();
                    l.Text  = var.Nombre;
                    l.Value = var.ClavePrelacionActo.ToString();
                    radbMovimientos.Items.Add(l);
                }
            }
            else
            {
                Server.Transfer("Registro.aspx");
            }
        }
Exemplo n.º 7
0
        protected void btAsignar_Click(object sender, EventArgs e)
        {
            Prelacion       pre       = new Prelacion();
            List <ListItem> selectedP = new List <ListItem>();

            foreach (ListItem item in cbSinAsignar.Items)
            {
                if (item.Selected)
                {
                    selectedP.Add(item);
                }
            }

            String usuario = rbUsuarios.SelectedValue;

            if (!usuario.Equals("") && selectedP.Count > 0)
            {
                foreach (ListItem item in selectedP)
                {
                    pre.GuardarNuevaPrelacionUsuario(int.Parse(item.Value), int.Parse(usuario), "ASIGNADA:" + DateTime.Now + ";");
                    Prelacion.CambiarEstadoPrelacion("ASIGNADA", int.Parse(item.Value));
                }
                limpiarListas();
                cargarListas();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Prelaciones Asignadas Correctamente')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Debes elegir un Usuario y al menos una Prelación')", true);
            }
        }
Exemplo n.º 8
0
        protected void btCambios_Click(object sender, EventArgs e)
        {
            Prelacion       pre       = new Prelacion();
            List <ListItem> selectedP = new List <ListItem>();

            foreach (ListItem item in cbAsignadas.Items)
            {
                if (item.Selected)
                {
                    selectedP.Add(item);
                }
            }
            String usuario = rbUsuarios2.SelectedValue;

            if (!usuario.Equals("") && selectedP.Count > 0)
            {
                foreach (ListItem item in selectedP)
                {
                    Prelacion prel = Prelacion.ObtenerPrelacionPorId(int.Parse(item.Value));
                    pre.ActualizarPrelacionUsuario(int.Parse(item.Value), int.Parse(prel.IdUsuario.ToString()), int.Parse(usuario), "REASIGNADA:" + DateTime.Now + ";");
                    Prelacion.CambiarEstadoPrelacion("ASIGNADA", int.Parse(item.Value));
                }
                limpiarListas();
                cargarListas();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Cambio de Asignación Correctamente')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Debes elegir un Usuario y al menos una Prelación')", true);
            }
        }
Exemplo n.º 9
0
        protected void btGuardarRegistro_Click(object sender, EventArgs e)
        {
            DataTable Temporal  = (DataTable)Session["tablaOt"];
            DataTable Temporal2 = (DataTable)Session["tablaAd"];

            if (!Temporal.Rows[0][0].ToString().Equals(""))
            {
                string[] datos = Session["REGISTRO"].ToString().Split(';');
                if (!datos[1].Equals("4") && Temporal2.Rows[0][0].ToString().Equals(""))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Debes introducir los datos del(os) Adquirientes.')", true);
                }
                else
                {
                    //obtener registro completo con todos los datos a guardar
                    RegistroActo registrocompleto = armarRegistro(datos[0], datos[1]);
                    //Si tiene un Registro es porque fue regresada en Verificacion.
                    RegistroActo registroGuardado = RegistroActo.ObtenerDatosRegistro(int.Parse(datos[0]));
                    if (registroGuardado != null)
                    {
                        registrocompleto.IdRegistro = registroGuardado.IdRegistro;
                    }
                    else
                    {
                        registrocompleto.IdRegistro = 0;
                    }
                    //Guardarregistro.
                    String resultado = RegistroActo.GuardarRegistroObjeto(registrocompleto);
                    if (resultado.Equals("OK"))
                    {
                        //Si se registraron todos los movimientos, debe cambiarse de estado a la prelacion.
                        listamovimientos = Prelacion.ObtenerMovimientosPrelacion(int.Parse(Session["IDPRELACION"].ToString()), "NOREGISTRADA");
                        if (listamovimientos.Count < 1)
                        {
                            //Cambiar estado de Prelacion "VERIFICACION"
                            Prelacion.CambiarEstadoPrelacion("VERIFICACION", int.Parse(Session["IDPRELACION"].ToString()));
                            Session["REGISTRO"]    = null;
                            Session["IDPRELACION"] = null;
                            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Registro Guardado Correctamente.')", true);
                            Response.Redirect("Registro.aspx");
                        }
                        else
                        {
                            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Prelación Registrada Correctamente.')", true);
                            Response.Redirect("Registrar.aspx");
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error al guardar el Registro." + resultado + "')", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Debes introducir los datos del(os) Otorgantes.')", true);
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Verificación de usuario
            Usuario currentUser = (Usuario)Session.Contents["usuario"];
            if (currentUser == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                if (currentUser.IdTipoUsuario != 4)
                {
                    switch (currentUser.IdTipoUsuario)
                    {
                    case 1:     //Administrador
                        Response.Redirect("Catalogos.aspx");
                        break;

                    case 2:    //Recepcion
                        Response.Redirect("Recepcion.aspx");
                        break;

                    case 3:    //Distribucion
                        Response.Redirect("Distribucion.aspx");
                        break;

                    case 4:    //Registrador
                        Response.Redirect("Registro.aspx");
                        break;

                    case 5:    //Verificación
                        Response.Redirect("Revision.aspx");
                        break;

                    case 6:    //Entrega
                        Response.Redirect("Entrega.aspx");
                        break;
                    }
                }
            }
            #endregion



            if (!IsPostBack)
            {
                prelacionElegida = Prelacion.ObtenerPrelacionPorId(int.Parse(Session["IDPRELACION"].ToString()));
                llenarListaMovimientos();
            }
            else
            {
                prelacionElegida = (Prelacion)HttpContext.Current.Session["prelacionElegida"];
            }
            obtenerAntecedentes();
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String fecha = Request.QueryString["fecha"];
            //Response.Write(fecha);
            List <Prelacion> prelaciones       = Prelacion.ObtenerPrelacionesEstatusFechaReporte("%", fecha);
            String           registradorActual = "";

            if (prelaciones.Count > 0)
            {
                Response.Write("<B>RELACION DE ASIGNACIÓN DE TRAMITES PARA REGISTRO</B>");
                Response.Write("<table border='1'>");
                for (int i = 0; i < prelaciones.Count; i++)
                {
                    if (registradorActual == prelaciones[i].Usuario)
                    {
                        Response.Write("<tr>");
                        Response.Write("<td>" + prelaciones[i].IdPrelacion + "</td>");
                        Response.Write("<td>" + prelaciones[i].NombreActo + "</td>");
                        Response.Write("<td>" + prelaciones[i].FechaAsignacion + "</td>");
                        Response.Write("<td>" + prelaciones[i].NumeroEscritura + "</td>");
                        Response.Write("<td>" + prelaciones[i].Status + "</td>");
                        Response.Write("</tr>");
                    }
                    else
                    {
                        registradorActual = prelaciones[i].Usuario;

                        Response.Write("<tr>");
                        Response.Write("<td colspan='3'><B>" + prelaciones[i].Usuario + "</B></td>");
                        Response.Write("</tr>");
                        Response.Write("<tr>");
                        Response.Write("<td><B>Número de prelación</B></td>");
                        Response.Write("<td><B>Acto</B></td>");
                        Response.Write("<td><B>Fecha de asignación</B></td>");
                        Response.Write("<td><B>Número de escritura</B></td>");
                        Response.Write("<td><B>Estatus</B></td>");
                        Response.Write("</tr>");

                        Response.Write("<tr>");
                        Response.Write("<td>" + prelaciones[i].IdPrelacion + "</td>");
                        Response.Write("<td>" + prelaciones[i].NombreActo + "</td>");
                        Response.Write("<td>" + prelaciones[i].FechaAsignacion + "</td>");
                        Response.Write("<td>" + prelaciones[i].NumeroEscritura + "</td>");
                        Response.Write("<td>" + prelaciones[i].Status + "</td>");
                        Response.Write("</tr>");
                    }
                    if (i == 0)
                    {
                        registradorActual = prelaciones[0].Usuario;
                    }
                }
                Response.Write("</table>");
            }
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //obtener el usuario que tiene la sesion
            Usuario currentUser = (Usuario)Session.Contents["usuario"];
            //obtener id_prelacion de la session
            int prelacionId = int.Parse(Session["IDPRELACION"].ToString());

            //int prelacionId = 2;
            lbFecha.Text              = DateTime.Today.ToShortDateString();
            lbHora.Text               = DateTime.Now.ToShortTimeString();
            lbPrelacion.Text          = prelacionId.ToString();
            gvAntecedentes.DataSource = Prelacion.ObtenerAntecedentesPrelacion(prelacionId);
            gvAntecedentes.DataBind();
            Prelacion pre = Prelacion.PrelacionPorId(prelacionId);

            lbFecha.Text       = pre.Fecha.ToString();
            lbUsuario.Text     = currentUser.Nombre + " " + currentUser.ApellidoPaterno + " " + currentUser.ApellidoMaterno;
            lbTramitante.Text  = pre.Tramitante;
            lbTitular.Text     = pre.NombreTitular;
            lbDescripcion.Text = pre.DescripcionBien;
            lbValorBase.Text   = pre.ValorInmueble.ToString();
            Tramitante tram = Tramitante.ObtenerTramitantePorId(pre.IdTramitante);

            lbRfc.Text        = tram.Rfc;
            lbDomicilio.Text  = tram.Calle + " " + tram.Numero + " " + tram.Colonia;
            lbDomicilio2.Text = tram.Municipio + " " + tram.Estado + " " + tram.CodigoPostal;

            gvServicios.DataSource = Prelacion.ObtenerMovimientosPrelacion(prelacionId, "");
            gvServicios.DataBind();

            gvCostos.DataSource = Prelacion.ObtenerCostosPrelacion(prelacionId);
            gvCostos.DataBind();
            lbTotal.Text = pre.Total.ToString();

            lbFecha2.Text              = DateTime.Today.ToShortDateString();
            lbHora2.Text               = DateTime.Now.ToShortTimeString();
            lbPrelacion2.Text          = prelacionId.ToString();
            gvAntecedentes2.DataSource = Prelacion.ObtenerAntecedentesPrelacion(prelacionId);
            gvAntecedentes2.DataBind();
            lbFecha2.Text       = pre.Fecha.ToString();
            lbUsuario2.Text     = currentUser.Nombre + " " + currentUser.ApellidoPaterno + " " + currentUser.ApellidoMaterno;
            lbTramitante2.Text  = pre.Tramitante;
            lbTitular2.Text     = pre.NombreTitular;
            lbDescripcion2.Text = pre.DescripcionBien;
            lbValorBase2.Text   = pre.ValorInmueble.ToString();
            lbRfc2.Text         = tram.Rfc;
            lbDomicilio12.Text  = tram.Calle + " " + tram.Numero + " " + tram.Colonia;
            lbDomicilio22.Text  = tram.Municipio + " " + tram.Estado + " " + tram.CodigoPostal;

            gvServicios2.DataSource = Prelacion.ObtenerMovimientosPrelacion(prelacionId, "");
            gvServicios2.DataBind();

            lbTotal2.Text = pre.Total.ToString();
        }
Exemplo n.º 13
0
        private void obtenerAntecedentes()
        {
            List <Antecedente> antecedentes = new List <Antecedente>();

            antecedentes = Prelacion.ObtenerAntecedentesPrelacion(prelacionElegida.IdPrelacion);

            gvAntecedentes.DataSource = antecedentes;
            gvAntecedentes.DataBind();

            HttpContext.Current.Session.Add("prelacionElegida", prelacionElegida);
        }
Exemplo n.º 14
0
        protected void CargarListas2()
        {
            Prelacion pre = new Prelacion();

            foreach (Prelacion var in pre.ObtenerPrelacionesEstatus("ASIGNADA"))
            {
                List <Movimientos> mov     = Prelacion.ObtenerMovimientosPrelacion(var.IdPrelacion, "");
                String             usuario = (var.Usuario.Length > 23) ? var.Usuario.Substring(0, 23) : var.Usuario;
                ListItem           item    = new ListItem();
                item.Text  = var.IdPrelacion.ToString() + " |" + mov[0].Acto.Nombre + " | <b> " + usuario + "</b>";
                item.Value = var.IdPrelacion.ToString();
                cbAsignadas.Items.Add(item);
            }
        }
Exemplo n.º 15
0
 protected void btGuardarRegistro_Click(object sender, EventArgs e)
 {
     if (prelacionElegida.IdPrelacion > 0)
     {
         Prelacion.CambiarEstadoPrelacion("ENTREGA", prelacionElegida.IdPrelacion);
         prelaciones              = new List <Prelacion>();
         prelacionElegida         = new Prelacion();
         prelaciones              = prelacionElegida.ObtenerPrelacionesEstatus("VERIFICACION");
         gvPrelaciones.DataSource = prelaciones;
         gvPrelaciones.DataBind();
         LimpiarCampos();
         prelacionElegida = null;
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Prelación ha pasado al Módulo de Entrega')", true);
     }
 }
Exemplo n.º 16
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         prelacionEncontrada       = Prelacion.ObtenerPrelacionPorId(int.Parse(txFolio.Text));
         antecedentesPrelacion     = Prelacion.ObtenerAntecedentesPrelacion(prelacionEncontrada.IdPrelacion);
         gvAntecedentes.DataSource = antecedentesPrelacion;
         gvAntecedentes.DataBind();
         Session["prelacionEncontrada"]   = prelacionEncontrada;
         Session["antecedentesPrelacion"] = antecedentesPrelacion;
         txFolio.Text = "";
     }
     catch (Exception exc)
     {
         lblError.Text = exc.Message;
     }
 }
Exemplo n.º 17
0
        protected Prelacion armarPrelacion(String total, DataTable Movimientos, DataTable Antecedentes)
        {
            String    valor     = txValorBase.Text.Replace('.', ',').ToString();
            Prelacion prelacion = new Prelacion();

            prelacion.IdTramitante      = int.Parse(ddlTramitantes.SelectedValue.ToString());
            prelacion.NombreTitular     = txNombreTitular.Text;
            prelacion.DescripcionBien   = txDescripcion.Text;
            prelacion.NumeroEscritura   = txNumeroEscritura.Text;
            prelacion.ValorInmueble     = Convert.ToDecimal(valor);
            prelacion.Folio             = txFolio.Text;
            prelacion.Total             = Convert.ToDecimal(total);
            prelacion.Status            = "RECEPCION";
            prelacion.Fecha             = txFecha.Text;
            prelacion.LugarOtorgamiento = txLugarOtorg.Text;
            prelacion.TipoDocumento     = txTipoDocto.Text;
            prelacion.TipoMoneda        = txMoneda.Text;
            prelacion.FechaDocumento    = txFechaOtorg.Text;
            //agregar Actos.
            prelacion.ActosPrelacion = new List <Movimientos>();
            foreach (DataRow row in Movimientos.Rows)
            {
                Movimientos mov = new Movimientos();
                mov.ClaveActo = int.Parse(row["Acto"].ToString());
                mov.Clave     = int.Parse(row["Movimiento"].ToString());
                mov.Importe   = Convert.ToDecimal(row["Subtotal"].ToString());
                prelacion.ActosPrelacion.Add(mov);
            }
            //agregarantecedentes
            prelacion.Antecedentes = new List <Antecedente>();
            foreach (DataRow row in Antecedentes.Rows)
            {
                Antecedente ant = new Antecedente();
                ant.Libro    = row["Libro"].ToString();
                ant.Tomo     = row["Tomo"].ToString();
                ant.Semestre = row["Semestre"].ToString();
                ant.Seccion  = row["Seccion"].ToString();
                ant.Serie    = row["Serie"].ToString();
                ant.Partida  = row["Partida"].ToString();
                ant.Año      = row["Año"].ToString();
                ant.Folio    = row["Folio"].ToString();
                prelacion.Antecedentes.Add(ant);
            }

            return(prelacion);
        }
Exemplo n.º 18
0
        private void SeleccionarPrelacion()
        {
            prelacionElegida = prelaciones[gvPrelaciones.SelectedIndex];

            /*
             * lbFecha.Text = prelacionElegida.Fecha;
             * lbFolio.Text = prelacionElegida.Folio;
             * lbTramitante.Text = prelacionElegida.Tramitante;
             * lbNumEscritura.Text = prelacionElegida.NumeroEscritura;
             * lbDescripcion.Text = prelacionElegida.DescripcionBien;
             * lbTitular.Text = prelacionElegida.NombreTitular;
             *
             * List<Antecedente> antecedentes = new List<Antecedente>();
             * antecedentes = Prelacion.ObtenerAntecedentesPrelacion(prelacionElegida.IdPrelacion);
             *
             * gvAntecedentes.DataSource = antecedentes;
             * gvAntecedentes.DataBind();
             *
             * movimientos = new List<Movimientos>();
             * movimientos = Prelacion.ObtenerMovimientosPrelacion(prelacionElegida.IdPrelacion, "");
             * gvMovimientos.DataSource = movimientos;
             * gvMovimientos.DataBind();
             */
            HttpContext.Current.Session.Add("prelacionElegida", prelacionElegida);


            Boolean flag = false;

            foreach (Prelacion item in listaEntrega)
            {
                if (item.IdPrelacion == prelacionElegida.IdPrelacion)
                {
                    flag = true;
                }
            }
            if (flag)
            {
            }
            else
            {
                listaEntrega.Add(prelacionElegida);
                Session.Add("listaEntrega", listaEntrega);
                gvEntrega.DataSource = listaEntrega;
                gvEntrega.DataBind();
            }
        }
Exemplo n.º 19
0
 protected void btRechazar_Click(object sender, EventArgs e)
 {
     if (prelacionElegida.IdPrelacion > 0)
     {
         Prelacion.CambiarEstadoPrelacion("REVISAR", prelacionElegida.IdPrelacion);
         Prelacion.CambiarEstadoMovimientos("REVISION", prelacionElegida.IdPrelacion);
         Prelacion.CambiarObservacionesVerificadorPrelacion(txObservaciones.Text, prelacionElegida.IdPrelacion);
         prelaciones              = new List <Prelacion>();
         prelacionElegida         = new Prelacion();
         prelaciones              = prelacionElegida.ObtenerPrelacionesEstatus("VERIFICACION");
         gvPrelaciones.DataSource = prelaciones;
         gvPrelaciones.DataBind();
         LimpiarCampos();
         prelacionElegida = null;
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Prelación ha regresado al Módulo de Registro')", true);
     }
 }
Exemplo n.º 20
0
        protected void radbMovimientos_SelectedIndexChanged(object sender, EventArgs e)
        {
            formularioRegistro.Visible = false;
            string[] datos = Session["IDPRELACION"].ToString().Split(';');
            if (datos.Length == 2)
            {
                listamovimientos = Prelacion.ObtenerMovimientosPrelacion(int.Parse(datos[0]), "REVISION");
            }
            else
            {
                listamovimientos = Prelacion.ObtenerMovimientosPrelacion(int.Parse(Session["IDPRELACION"].ToString()), "");
            }

            foreach (Movimientos var in listamovimientos)
            {
                if (radbMovimientos.SelectedValue.Equals(var.ClavePrelacionActo.ToString()))
                {
                    ddlSeccion.Visible = true;
                    ddlSeccion.Items.Clear();
                    ddlSeccion.Items.Add("Elige una Seccion");
                    string[] words = var.Acto.Seccion.ToString().Split(';');
                    foreach (string word in words)
                    {
                        ListItem l    = new ListItem();
                        String   secc = Acto.ObtenerSeccion(word);
                        l.Text  = secc;
                        l.Value = word;
                        ddlSeccion.Items.Add(l);
                    }
                    ddlSeccion.Items.RemoveAt(ddlSeccion.Items.Count - 1);
                    if (ddlSeccion.Items.Count > 2)
                    {
                        ddlSeccion.Visible = true;
                    }
                    else
                    {
                        ddlSeccion.Visible = false;
                    }
                }
            }
        }
Exemplo n.º 21
0
        protected void Unnamed_Click(object sender, EventArgs e)
        {
            if ((rbSinRegistrar.SelectedIndex != -1 || rbObservaciones.SelectedIndex != -1))
            {
                Session["IDPRELACION"] = (rbSinRegistrar.SelectedIndex == -1) ?  rbObservaciones.SelectedValue : rbSinRegistrar.SelectedValue;

                if (rbObservaciones.SelectedIndex != -1)
                {
                    Response.Redirect("Registrar.aspx");
                }
                else
                {
                    listamovimientos = Prelacion.ObtenerMovimientosPrelacion(int.Parse(Session["IDPRELACION"].ToString()), "NOREGISTRADA");
                    int cont = 0;
                    foreach (Movimientos mov in listamovimientos)
                    {
                        String[] secci = mov.Acto.Seccion.ToString().Split(';');
                        if (secci[0].Length > 3)
                        {
                            cont++;
                        }
                    }
                    if (listamovimientos.Count == cont)
                    {
                        Prelacion.CambiarEstadoPrelacion("ENTREGA", int.Parse(Session["IDPRELACION"].ToString()));
                        Prelacion.CambiarEstadoMovimientos("REGISTRADA", int.Parse(Session["IDPRELACION"].ToString()));
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Todos son Movimientos NO Registrales. Prelación Registrada con éxito.')", true);
                        Usuario currentUser = (Usuario)Session.Contents["usuario"];
                        llenarCheckboxList(currentUser.IdUsuario);
                    }
                    else
                    {
                        Response.Redirect("Registrar.aspx");
                    }
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Debes elegir una Prelación a Registrar.')", true);
            }
        }
Exemplo n.º 22
0
        protected void btGuardarRegistro_Click(object sender, EventArgs e)
        {
            try
            {
                if (listaEntrega.Count > 0)
                {
                    string s = "";
                    foreach (Prelacion item in listaEntrega)
                    {
                        Prelacion.EntregarPrelacion(item.IdPrelacion, txNombreRecibe.Text, ddlTipoIdentificacion.Text, txClave.Text);
                        Prelacion.CambiarEstadoPrelacion("ENTREGADA", item.IdPrelacion);

                        //codigo para abrir la ventana de impresion de la boleta
                        //Session["IDPRELACION"] = item.IdPrelacion;
                        //Session["NOMBRE"] = txNombreRecibe.Text;
                        string url = "BoletaEntrega.aspx?IdPrelacion=" + item.IdPrelacion + "&Nombre=" + txNombreRecibe.Text;
                        s = s + "window.open('" + url + "', '_blank');";
                        ////
                    }

                    ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);
                    prelaciones              = new List <Prelacion>();
                    prelacionElegida         = new Prelacion();
                    listaEntrega             = new List <Prelacion>();
                    prelaciones              = prelacionElegida.ObtenerPrelacionesEstatus("ENTREGA");
                    gvPrelaciones.DataSource = prelaciones;
                    gvPrelaciones.DataBind();
                    Session.Add("listaEntrega", listaEntrega);
                    gvEntrega.DataSource = listaEntrega;
                    gvEntrega.DataBind();
                    txNombreRecibe.Text = "";
                    txClave.Text        = "";
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Prelación Finalizada y Entregada.')", true);
                }
            }
            catch (Exception exc)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error. No ha elegido una prelación.')", true);
            }
        }
Exemplo n.º 23
0
        protected void cargarListas()
        {
            Prelacion pre = new Prelacion();

            //Llenar el CheckBoxList de Prelaciones Sin Asignar
            foreach (Prelacion var in pre.ObtenerPrelacionesEstatus("RECEPCION"))
            {
                ListItem           item = new ListItem();
                List <Movimientos> mov  = Prelacion.ObtenerMovimientosPrelacion(var.IdPrelacion, "");
                item.Text  = "<b>" + var.IdPrelacion.ToString() + "</b> |" + mov[0].Acto.Nombre;
                item.Value = var.IdPrelacion.ToString();
                cbSinAsignar.Items.Add(item);
            }

            /*
             * //Llenar el CheckBoxList de Prelaciones Asignadas
             * foreach (Prelacion var in pre.ObtenerPrelacionesEstatus("ASIGNADA"))
             * {
             *  List<Movimientos> mov = Prelacion.ObtenerMovimientosPrelacion(var.IdPrelacion,"");
             *  String usuario = (var.Usuario.Length > 23) ? var.Usuario.Substring(0, 23) : var.Usuario;
             *  ListItem item = new ListItem();
             *  item.Text = var.IdPrelacion.ToString() + " |" + mov[0].Acto.Nombre + " | <b> " + usuario + "</b>";
             *  item.Value = var.IdPrelacion.ToString();
             *  cbAsignadas.Items.Add(item);
             * }
             */
            //Llenar los RadioButtonList y Dropdownlist para Usuarios.
            foreach (Usuario var in main.Usuarios.CatalogoRegistradores())
            {
                ListItem item   = new ListItem();
                String   nombre = var.Nombre + " " + var.ApellidoPaterno + " " + var.ApellidoMaterno;
                nombre     = (nombre.Length > 35)? nombre.Substring(0, 35) : nombre;
                item.Text  = nombre;
                item.Value = var.IdUsuario.ToString();
                ddlUsuarios.Items.Add(item);
                rbUsuarios.Items.Add(item);
                rbUsuarios2.Items.Add(item);
            }
        }
Exemplo n.º 24
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            List <Prelacion> lista = new List <Prelacion>();
            Prelacion        p     = new Prelacion();

            lista = p.ObtenerPrelacionesEstatusReporte("ENTREGADA");

            gvResultados.DataSource = null;
            gvResultados.DataBind();
            lblError.Text = "";

            if (lista.Count > 0)
            {
                gvResultados.DataSource = lista;
                gvResultados.DataBind();
                lblError.Text = "Se encontraron " + lista.Count.ToString() + " resultados.";
            }
            else
            {
                lblError.Text = "No se encontraron resultados";
            }
        }
Exemplo n.º 25
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            List <Prelacion> lista = new List <Prelacion>();
            Prelacion        p     = new Prelacion();

            lista = p.ObtenerPrelacionesActo(int.Parse(ddlActos.SelectedValue));

            gvResultados.DataSource = null;
            gvResultados.DataBind();
            lblError.Text = "";

            if (lista.Count > 0)
            {
                gvResultados.DataSource = lista;
                gvResultados.DataBind();
                lblError.Text = "Se encontraron " + lista.Count.ToString() + " resultados.";
            }
            else
            {
                lblError.Text = "No se encontraron resultados";
            }
        }
Exemplo n.º 26
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int idPrelacion = (int)Session["bIdPrelacion"];

            if (idPrelacion > 0)
            {
                Prelacion.CambiarEstadoPrelacion("CANCELADA", idPrelacion);
                txBNuevoTitular.Text         = "";
                txBDescripcion.Text          = "";
                txBEscritura.Text            = "";
                txBLugarOtorgamiento.Text    = "";
                txBTipoDocumento.Text        = "";
                txBFechaOtorgamiento.Text    = "";
                txBFolio.Text                = "";
                ddlBTramitante.SelectedIndex = 0;
                Session["bIdPrelacion"]      = null;
                Session["bAntecedentes"]     = null;
                txBuscarPrelacion.Text       = "";
                gvBAntecedentes.DataSource   = null;
                gvBAntecedentes.DataBind();
            }
        }
Exemplo n.º 27
0
        protected void txbFiltroEntrega_TextChanged(object sender, EventArgs e)
        {
            prelaciones = new List <Prelacion>();

            prelacionElegida       = new Prelacion();
            Session["IDPRELACION"] = null;
            if (txbFiltroEntrega.Text.Length > 0)
            {
                prelaciones = prelacionElegida.ObtenerPrelacionesEstatusFiltro("ENTREGA", txbFiltroEntrega.Text);
            }
            else
            {
                prelaciones = prelacionElegida.ObtenerPrelacionesEstatusFiltro("ENTREGA", "%");
            }
            gvPrelaciones.DataSource = prelaciones;
            gvPrelaciones.DataBind();

            listaEntrega = new List <Prelacion>();
            listaEntrega = (List <Prelacion>)Session["listaEntrega"];
            if (listaEntrega != null)
            {
                gvEntrega.DataSource = listaEntrega;
                gvEntrega.DataBind();
            }
            else
            {
                listaEntrega = new List <Prelacion>();
            }

            if (IsPostBack)
            {
                prelacionElegida = (Prelacion)HttpContext.Current.Session["prelacionElegida"];
            }
            if (!IsPostBack)
            {
                llenarDatosUsuario();
            }
        }
Exemplo n.º 28
0
 protected void ddlUsuarios_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!ddlUsuarios.SelectedValue.ToString().Equals("0"))
     {
         Prelacion pre = new Prelacion();
         cbAsignadas.Items.Clear();
         //Llenar el CheckBoxList de Prelaciones Asignadas segun un Usuario
         foreach (Prelacion var in pre.ObtenerPrelacionesUsuario(int.Parse(ddlUsuarios.SelectedValue.ToString()), "ASIGNADA"))
         {
             List <Movimientos> mov     = Prelacion.ObtenerMovimientosPrelacion(var.IdPrelacion, "");
             String             usuario = (var.Usuario.Length > 23) ? var.Usuario.Substring(0, 23) : var.Usuario;
             ListItem           item    = new ListItem();
             item.Text  = var.IdPrelacion.ToString() + " |" + mov[0].Acto.Nombre + " | <b> " + usuario + "</b>";
             item.Value = var.IdPrelacion.ToString();
             cbAsignadas.Items.Add(item);
         }
     }
     else
     {
         limpiarListas();
         cargarListas();
     }
 }
Exemplo n.º 29
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            if (txBuscarPrelacion.Text.Length > 0)
            {
                Prelacion pre = Prelacion.ObtenerPrelacionPorIdBusqueda(int.Parse(txBuscarPrelacion.Text));

                if (pre.IdPrelacion > 0)
                {
                    txBNuevoTitular.Text         = pre.NombreTitular;
                    txBFolio.Text                = pre.Folio;
                    txBEscritura.Text            = pre.NumeroEscritura;
                    txBDescripcion.Text          = pre.DescripcionBien;
                    txBTipoDocumento.Text        = pre.TipoDocumento;
                    txBFechaOtorgamiento.Text    = pre.FechaDocumento;
                    txBLugarOtorgamiento.Text    = pre.LugarOtorgamiento;
                    ddlBTramitante.SelectedValue = pre.IdTramitante.ToString();
                    gvBAntecedentes.DataSource   = pre.Antecedentes;
                    gvBAntecedentes.DataBind();
                    Session["bAntecedentes"] = pre.Antecedentes;
                    Session["bIdPrelacion"]  = pre.IdPrelacion;
                }
            }
        }
Exemplo n.º 30
0
        private void SeleccionarPrelacion()
        {
            prelacionElegida    = prelaciones[gvPrelaciones.SelectedIndex];
            lbFecha.Text        = prelacionElegida.Fecha;
            lbFolio.Text        = prelacionElegida.Folio;
            lbTramitante.Text   = prelacionElegida.Tramitante;
            lbNumEscritura.Text = prelacionElegida.NumeroEscritura;
            lbDescripcion.Text  = prelacionElegida.DescripcionBien;
            lbTitular.Text      = prelacionElegida.NombreTitular;

            List <Antecedente> antecedentes = new List <Antecedente>();

            antecedentes = Prelacion.ObtenerAntecedentesPrelacion(prelacionElegida.IdPrelacion);

            gvAntecedentes.DataSource = antecedentes;
            gvAntecedentes.DataBind();

            movimientos = new List <Movimientos>();
            movimientos = Prelacion.ObtenerMovimientosPrelacion(prelacionElegida.IdPrelacion, "");
            gvMovimientos.DataSource = movimientos;
            gvMovimientos.DataBind();

            HttpContext.Current.Session.Add("prelacionElegida", prelacionElegida);
        }