コード例 #1
0
 private void FrmVentas_Load(object sender, EventArgs e)
 {
     Cls.ClsUs ObjUS = new Cls.ClsUs();                    //Referencio al usuario
     DTPel      = ObjUS.BuscarPeliculas();                 //Le guardo las películas
     DTClientes = ObjUS.BuscarClientes();
     for (int i = 0; i < DTPel.Rows.Count; i++)            //Inserto tantas películas como haya disponibles para insertar
     {
         CmbPelicula.AddItem(DTPel.Rows[i][1].ToString()); //Inserto específicamente los nombres en el combobox
     }
     for (int i = 0; i < DTClientes.Rows.Count; i++)
     {                                                          //Inserto tantas películas como haya disponibles para insertar
         CmbClientes.AddItem(DTClientes.Rows[i][1].ToString()); //Inserto específicamente los nombres en el combobox
     }
 }
コード例 #2
0
        private void BttnGuardar_Click(object sender, EventArgs e)
        {
            Cls.ClsUs      ObjUs = new Cls.ClsUs();//Preparo los objetos para poder utilizarlos
            Cls.ClsCliente ObjCliente;
            String         Nombre, Telefono, Direccion;

            if (TxtNom.Text != "" & TxtTel.Text != "" & TxtDir.Text != "") //compruebo si se han rellenado los campos del cliente
            {
                Nombre     = TxtNom.Text;                                  //Obtengo los datos del cliente para a posterior guardarlos
                Telefono   = TxtTel.Text;
                Direccion  = TxtDir.Text;
                ObjCliente = new Cls.ClsCliente(Nombre, Telefono, Direccion);     //Creo el objeto mediante su constructor
                ObjUs.ACliente(ObjCliente);                                       //Guardo el cliente
                BCDGrid.DataSource = ObjUs.BuscarClientes();                      //Actualizo la grilla con los clientes almacenados
                DVCliente          = new DataView((DataTable)BCDGrid.DataSource); //LLeno el DVCLiente para buscar los usuarios
                LimpiarFormulario();                                              //Limpio el formulario
            }
            else  //Si no se han ingresado todos los valores lo digo
            {
                LblError.Visible = true;
                LblError.Text    = "ERROR: No deben de haber campos sin ingresar";
            }
        }
コード例 #3
0
 private void FrmCliente_Load(object sender, EventArgs e)
 {
     Cls.ClsUs ObjUsuario = new Cls.ClsUs();
     BCDGrid.DataSource = ObjUsuario.BuscarClientes();
     DVCliente          = new DataView((DataTable)BCDGrid.DataSource);//Lleno el DVCliente para luego buscar
 }