Example #1
0
        public void btnGuardar_Click(object sender, EventArgs e)
        {
            TerminalDestinoNegocio negocio = new TerminalDestinoNegocio();

            try
            {
                if (terminalDestino == null)
                {
                    terminalDestino = new TerminalDestino();
                }

                terminalDestino.CodTerminal    = txtCodTerminal.Text.Trim();
                terminalDestino.NombreTerminal = txtNomTermianl.Text.Trim();
                //chofer.Estado = txtEstado.Text.Trim();
                terminalDestino.Estado = "A";

                if (terminalDestino.IdTerminal == 0)
                {
                    negocio.agregar(terminalDestino);
                }


                Response.Redirect("TerminalesDestino.aspx");


                //else
                //    negocio.modificar(articulo);

                //Dispose();
            }
            catch (Exception EX)
            {
                throw EX;
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                TerminalDestinoNegocio negocio = new TerminalDestinoNegocio();
                listaTerminalesDestino          = negocio.listar2();
                dgvTerminalesDestino.DataSource = listaTerminalesDestino;
                dgvTerminalesDestino.DataBind();

                Session[Session.SessionID + "listaTerminalesDestino"] = listaTerminalesDestino;

                //cboti.DataSource = listaPokemons;
                //cboPokemons.DataBind();


                //cboPokemons.Items.Add("Rojo");
                //cboPokemons.Items.Add("Azul");
                //cboPokemons.Items.Add("Verde");

                if (!IsPostBack)
                { //pregunto si es la primera carga de la page
                  //txtNumeroPokemon.Text = "150";
                  //cbotipoArt.DataSource = listaArticulos;
                  //cbotipoArt.DataBind();

                    //esto es lo que necesitamos para el repeater.
                    //repetidor.DataSource = listaPokemons;
                    //repetidor.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            TerminalDestinoNegocio negocio = new TerminalDestinoNegocio();

            try
            {
                terminalDestino = new TerminalDestino();

                terminalDestino.IdTerminal     = int.Parse(txtID.Text.Trim());
                terminalDestino.CodTerminal    = txtCodTerminal.Text.Trim();
                terminalDestino.NombreTerminal = txtNomTerminal.Text.Trim();
                terminalDestino.Estado         = "A";

                //if (chofer.IdChofer == 0)
                negocio.modificarTerminal(terminalDestino);


                Response.Redirect("TerminalesDestino.aspx");


                //else
                //    negocio.modificar(articulo);

                //Dispose();
            }
            catch (Exception EX)
            {
                throw EX;
            }
        }
Example #4
0
        protected void dgvTerminalesDestino_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Eliminar")
            {
                int    index      = Convert.ToInt32(e.CommandArgument);
                string idTerminal = dgvTerminalesDestino.Rows[index].Cells[1].Text;
                TerminalDestinoNegocio negocio = new TerminalDestinoNegocio();
                negocio.bajaTerminal(idTerminal);
                Response.Redirect("TerminalesDestino.aspx");
            }



            //if(e.CommandName == "Modificar")
            //{
            //    Response.Redirect("NuevoChofer.aspx");

            //    //int index = Convert.ToInt32(e.CommandArgument);
            //    //Chofer chofer = new Chofer();
            //    //chofer = (Chofer)dgvChoferes.Rows.Cast;
            //}
        }