Esempio n. 1
0
        private void Lst_Datos_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Cada cambio en el index de la lista carga por el ID los datos
            customersOP CuoP = new customersOP();

            Charge(CuoP.GetCustomerById(Ids[Lst_Datos.SelectedIndex]));
        }
Esempio n. 2
0
        public void Charge()//carga datos al list y ala lista
        {
            customersOP Custop = new customersOP();

            Lst_Datos.Items.Clear();
            foreach (Customer c in Custop.GetCustomers())
            {
                Lst_Datos.Items.Add(c.ContactName);
                Ids.Add(c.CustomerID);
            }
            Lst_Datos.SelectedIndex = 0;
            Charge(Custop.GetCustomerById(Ids[0]));//cargo el primero objeto de la lsita de strings ids
        }
Esempio n. 3
0
        private void Btn_Buscar_Click(object sender, EventArgs e)
        {
            string      identificador;
            customersOP Cuop = new customersOP();

            if (Txb_Id.Text != "")
            {
                identificador = Txb_Id.Text;
                Charge(Cuop.GetCustomerById(identificador));//metodo de carga de datos a textbox
            }
            else if (Txb_ContactName.Text != "")
            {
                identificador = Txb_ContactName.Text;
                Charge(Cuop.GetCustomerByName(identificador));
            }
        }
Esempio n. 4
0
        private void Btn_edit_Click(object sender, EventArgs e)
        {
            string      identificador;
            customersOP Cuop = new customersOP();

            if (Txb_Id.Text != "")
            {
                identificador = Txb_Id.Text;
                Edit(Cuop.GetCustomerById(identificador));//Metodo para editar los campos del objeto
            }
            else if (Txb_ContactName.Text != "")
            {
                identificador = Txb_ContactName.Text;
                Edit(Cuop.GetCustomerByName(identificador));
            }
            else
            {
                MessageBox.Show("Escriba un ID o un Nombre para actualizar");
            }
        }