Esempio n. 1
0
 void BtnGrabarJur_Click(object sender, EventArgs e)
 {
     BtnGoodJuridico.Visible = false;
     LblGoodJuridico.Text    = "";
     if (ValidaJur() == true)
     {
         if (TxtEstadoJur.Text == "1")
         {
             ClUsuario.Insertar_Actividad_Pagina(14, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 4);
             ClPersonaJuridica.Insertar_Persona_Juridica(ClPersonaJuridica.Max_Persona_Juridica(), Convert.ToInt32(Session["UsuarioId"]), Convert.ToInt32(CboTipo.SelectedValue), TxtNombreJur.Text, Convert.ToDateTime(string.Format("{0:dd/MM/yyyy}", TxtFecRepre.SelectedDate)), TxtActa.Text, Convert.ToInt32(TxtNumero.Text), Convert.ToInt32(TxtFolio.Text), Convert.ToInt32(TxtLibro.Text), TxtNitJur.Text);
             GrdJuridico.Rebind();
             DivActa.Visible     = false;
             DivJuridico.Visible = false;
             Limpiar();
             BtnGoodJuridico.Visible = true;
             LblGoodJuridico.Text    = "Persona Jurídica agregada correctamente";
         }
         else
         {
             ClUsuario.Insertar_Actividad_Pagina(14, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 2);
             ClPersonaJuridica.Actualiza_Persona_Juridica(Convert.ToInt32(TxtPersonaJuridicaId.Text), Convert.ToInt32(CboTipo.SelectedValue), TxtNombreJur.Text, Convert.ToDateTime(string.Format("{0:dd/MM/yyyy}", TxtFecRepre.SelectedDate)), TxtActa.Text, Convert.ToInt32(TxtNumero.Text), Convert.ToInt32(TxtFolio.Text), Convert.ToInt32(TxtLibro.Text), TxtNitJur.Text);
             GrdJuridico.Rebind();
             DivActa.Visible     = false;
             DivJuridico.Visible = false;
             Limpiar();
             BtnGoodJuridico.Visible = true;
             LblGoodJuridico.Text    = "Persona Jurídica modificada correctamente";
         }
     }
 }
Esempio n. 2
0
 void GrdJuridico_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     BtnGoodJuridico.Visible = false;
     LblGoodJuridico.Text    = "";
     if (e.CommandName == "CmdEdit")
     {
         TxtEstadoJur.Text         = "2";
         TxtPersonaJuridicaId.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PersonaJuridicaId"].ToString();
         ClUsuario.Insertar_Actividad_Pagina(14, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 2);
         ds = ClPersonaJuridica.Persona_Juridica_Get_CorrJur(Convert.ToInt32(TxtPersonaJuridicaId.Text));
         CboTipo.SelectedValue     = ds.Tables["DATOS"].Rows[0]["Tipo_JuridicoId"].ToString();
         CboTipo.SelectedItem.Text = ds.Tables["DATOS"].Rows[0]["Tipo_Juridico"].ToString();
         TxtNombreJur.Text         = ds.Tables["DATOS"].Rows[0]["Nombre"].ToString();
         TxtActa.Text        = ds.Tables["DATOS"].Rows[0]["No_Acta"].ToString();
         TxtNumero.Text      = ds.Tables["DATOS"].Rows[0]["Numero"].ToString();
         TxtNumeroHide.Text  = ds.Tables["DATOS"].Rows[0]["Numero"].ToString();
         TxtFolio.Text       = ds.Tables["DATOS"].Rows[0]["Folio"].ToString();
         TxtLibro.Text       = ds.Tables["DATOS"].Rows[0]["Libro"].ToString();
         TxtNitJur.Text      = ds.Tables["DATOS"].Rows[0]["Nit"].ToString();
         DivJuridico.Visible = true;
         if (CboTipo.SelectedValue == "10")
         {
             DivActa.Visible = true;
         }
         else
         {
             DivActa.Visible = false;
         }
         if (CboTipo.SelectedValue != "7")
         {
             TxtFecRepre.SelectedDate = Convert.ToDateTime(ds.Tables["DATOS"].Rows[0]["Fecha"]);
         }
         else
         {
             TxtFecRepre.Clear();
         }
     }
     else if (e.CommandName == "CmdDel")
     {
         ClUsuario.Insertar_Actividad_Pagina(14, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 3);
         ClPersonaJuridica.Persona_Juridica_Delete(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PersonaJuridicaId"]));
         GrdJuridico.Rebind();
         TxtEstadoJur.Text       = "1";
         DivJuridico.Visible     = false;
         DivActa.Visible         = false;
         BtnGoodJuridico.Visible = true;
         LblGoodJuridico.Text    = "Persona Jurídica eliminada";
     }
 }