예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool acceso = false;

        if (Session["Empleado"] != null)
        {
            acceso = true;
        }
        if (!acceso)
        {
            Response.Redirect("Login.aspx");
        }

        if (Session["Usuario"] == string.Empty)
        {
            //Usuario Anónimo
            Response.Redirect("Login.aspx");
        }
        if (!IsPostBack)
        {
            btnEliminar.Enabled = false;
            int idemp = EmpleadoDao.UltimoID();
            cargarDDLCargo();
            cargarDDLCargo();
            CargarGrilla();
        }
    }
예제 #2
0
    protected void limpiar()
    {
        ID = null;
        int ultimo;

        if (EmpleadoDao.UltimoID() != 1)
        {
            ultimo = EmpleadoDao.UltimoID();
        }
        else
        {
            ultimo = EmpleadoDao.UltimoID() - 1;
        }
        txtNombre.Text         = String.Empty;
        txtApellido.Text       = String.Empty;
        txtFechaNac.Text       = String.Empty;
        txtDNI.Text            = String.Empty;
        ddlCargo.SelectedIndex = 0;
        txtCuenta.Text         = String.Empty;
        chkPedidos.Checked     = false;
    }