private void LlenarCuentas()
 {
     DropDownList1.DataSource     = CuentasBLL.GetListAll();
     DropDownList1.DataValueField = "CuentaId";
     DropDownList1.DataTextField  = "Nombre";
     DropDownList1.DataBind();
 }
Exemple #2
0
        protected void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (Validar())
            {
                LlenarCamposInstancia();

                if (CuentasBLL.Guardar(cuentas))
                {
                    CuentaIdTexBox.Text = cuentas.CuentaId.ToString();
                    //MensajeGuardado.Text = "Gardo";
                    AlertGuardar.Visible = true;
                    //ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['success']('Usuario guardado con exito');", addScriptTags: true);
                    //UtilidadesWeb.MostrarToastr(this, "Guardado", "Usuario", "info");
                    Limpiar();
                }
                else
                {
                    AlertError.Visible = true;
                }
            }
            else
            {
                Alert.Visible = true;
            }
        }
        private void LlenarCuentas()
        {
            List <Cuentas> Lista = CuentasBLL.GetListAll();

            CuentaDropDownList.DataSource     = Lista;
            CuentaDropDownList.DataValueField = "CuentaId";
            CuentaDropDownList.DataTextField  = "Nombre";
            CuentaDropDownList.DataBind();
        }
Exemple #4
0
        private void Filtrar()
        {
            DateTime FechaDesde = new DateTime();
            DateTime FechaHasta = new DateTime();

            if (FiltrarFechaCheckBox.Checked)
            {
                FechaDesde = Convert.ToDateTime(FechaDesdeTextBox.Text);
                FechaHasta = Convert.ToDateTime(FechaHastaTextBox.Text);
            }

            if (FiltrarDropDownList.SelectedIndex == 0)
            {
                if (FiltrarFechaCheckBox.Checked)
                {
                    Lista = CuentasBLL.GetList(p => p.Fecha >= FechaDesde.Date && p.Fecha <= FechaHasta.Date);
                }
                else
                {
                    Lista = CuentasBLL.GetListAll();
                }
            }
            else if (FiltrarDropDownList.SelectedIndex != 0)
            {
                if (FiltrarDropDownList.SelectedIndex == 2)
                {
                    if (FiltrarFechaCheckBox.Checked)
                    {
                        Lista = CuentasBLL.GetList(p => p.Nombre == FiltroTextBox.Text && p.Fecha >= FechaDesde.Date && p.Fecha <= FechaHasta.Date);
                    }
                    else
                    {
                        Lista = CuentasBLL.GetList(p => p.Nombre == FiltroTextBox.Text);
                    }
                }


                if (FiltrarDropDownList.SelectedIndex == 1)
                {
                    int id = Utilidades.TOINT(FiltroTextBox.Text);
                    if (FiltrarFechaCheckBox.Checked)
                    {
                        Lista = CuentasBLL.GetList(p => p.CuentaId == id && p.Fecha >= FechaDesde.Date && p.Fecha <= FechaHasta.Date);
                    }
                    else
                    {
                        Lista = CuentasBLL.GetList(p => p.CuentaId == id);
                    }
                }
            }
            CargarListaCuenta();
            if (Lista.Count() == 0)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['info']('No existe usuario');", addScriptTags: true);
                ImprimirButton.Visible = false;
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cuenta = null;

            if (!Page.IsPostBack)
            {
                Lista = CuentasBLL.GetListAll();
            }
            BotonImprimirVisibleSiHayListas();
            VisibleInvisibleFechas();
        }
Exemple #6
0
 protected void BtnGuardar_Click(object sender, EventArgs e)
 {
     if (Validar())
     {
         LlenarCamposInstancia();
         if (CuentasBLL.Guardar(cuentas))
         {
             Id.Text = cuentas.CuentaId.ToString();
             AlertGuardar.Visible = true;
         }
     }
 }