Exemple #1
0
        //--------------------Metodos de actualizaciones-------------------------

        private void ReloadClient()
        {
            clientModels = ClientManagement.SelectAllClients();
            ClientDataGridView.MultiSelect = false;
            ClientDataGridView.DataSource  = clientModels;

            ClientDataGridView.Columns["Id_Client"].AutoSizeMode           = DataGridViewAutoSizeColumnMode.AllCells;
            ClientDataGridView.Columns["Name"].AutoSizeMode                = DataGridViewAutoSizeColumnMode.Fill;
            ClientDataGridView.Columns["LastName"].AutoSizeMode            = DataGridViewAutoSizeColumnMode.Fill;
            ClientDataGridView.Columns["Identification_Type"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            ClientDataGridView.Columns["Identification"].AutoSizeMode      = DataGridViewAutoSizeColumnMode.AllCells;
            ClientDataGridView.Columns["Email"].AutoSizeMode               = DataGridViewAutoSizeColumnMode.AllCells;
            ClientDataGridView.Columns["Born_Date"].AutoSizeMode           = DataGridViewAutoSizeColumnMode.AllCells;
            ClientDataGridView.Columns["Registration_Date"].AutoSizeMode   = DataGridViewAutoSizeColumnMode.AllCells;

            ClientDataGridView.Columns["Id_Client"].HeaderText           = "Id";
            ClientDataGridView.Columns["Name"].HeaderText                = "Nombre";
            ClientDataGridView.Columns["LastName"].HeaderText            = "Apellidos";
            ClientDataGridView.Columns["Identification_Type"].HeaderText = "Tipo de Identificación";
            ClientDataGridView.Columns["Identification"].HeaderText      = "Identificación";
            ClientDataGridView.Columns["Email"].HeaderText               = "Correo electronico";
            ClientDataGridView.Columns["Born_Date"].HeaderText           = "Fecha de Nacimiento";
            ClientDataGridView.Columns["Registration_Date"].HeaderText   = "Fecha de Registro";

            ClientDataGridView.Columns["Id_Client"].Visible = false;
            ClientDataGridView.Columns["Born_Date"].DefaultCellStyle.Format         = "d";
            ClientDataGridView.Columns["Registration_Date"].DefaultCellStyle.Format = "d";

            ClientDataGridView.Columns["Born_Date"].DefaultCellStyle.Alignment         = DataGridViewContentAlignment.MiddleCenter;
            ClientDataGridView.Columns["Registration_Date"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            ClientDataGridView.Columns["Identification"].DefaultCellStyle.Alignment    = DataGridViewContentAlignment.MiddleCenter;
        }
Exemple #2
0
 private void UcAparts_Load(object sender, EventArgs e)
 {
     employeeComboBox.DataSource    = EmployeeManagement.SelectAllEmployees();
     employeeComboBox.DisplayMember = "Name";
     StoreComboBox.DataSource       = BusinessManagement.SelectAllBusiness();
     StoreComboBox.DisplayMember    = "fantasyName";
     clientComboBox.DataSource      = ClientManagement.SelectAllClients();
     clientComboBox.DisplayMember   = "Name";
     WrapProductsGridView();
 }
        //---------EVENTS---------//

        private void txtSearchClient_KeyPress(object sender, KeyPressEventArgs e)
        {
            string text = txtSearchClient.Text;

            try
            {
                if (text != "")
                {
                    clientsGridView.DataSource = ClientManagement.SelectClientByNameOrLastName(text);
                }
                else
                {
                    clientsGridView.DataSource = ClientManagement.SelectAllClients();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 private void UcClient_Load(object sender, EventArgs e)
 {
     try
     {
         if (ClientManagement.SelectAllClients() != null)
         {
             clientModels = ClientManagement.SelectAllClients();
             WireUpClientsGridView();
             FrmMain.Instance.ToolStripLabel.Text = "Los registros de la base de datos fueron cargados.";
         }
         else
         {
             FrmMain.Instance.ToolStripLabel.Text = "No se encontraron registros en la base de datos.";
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #5
0
 private void NewButton_Click_1(object sender, EventArgs e)
 {
     Clear();
     clientModels = ClientManagement.SelectAllClients();
     ClientDataGridView.DataSource = clientModels;
 }