private void uctSupport_Load(object sender, EventArgs e) { List <Support> supports = new Support { }.ObterTodos(); UtilCreatePanel.CreateSupportPanel(supports, uiFlowPanel, support_Click); }
private void uiTxtSearch_TextChanged(object sender, EventArgs e) { try { uiFlowPanel.Controls.Clear(); Employee employee = new Employee { CPF = uiTxtSearch.Text }.ObterInicialCPF(); UtilCreatePanel.CreateUserPanel(employee, uiFlowPanel, Employee_Click); //CreateUserPanel(employee, uiFlowPanel); } catch (NullReferenceException) { if (uiTxtSearch.TextLength == 11) { new Alert("CPF inválido ou não cadastrado.", Type.Warning); } else if (uiTxtSearch.TextLength == 0) { List <Employee> employeeList = new Employee { }.ObterTodos(); UtilCreatePanel.CreateUserPanel(employeeList, uiFlowPanel, Employee_Click); } } catch (Exception ex) { new Alert(ex.Message, Type.Warning); } }
private void uctSupport_VisibleChanged(object sender, EventArgs e) { uiFlowPanel.Controls.Clear(); List <Support> supports = new Support { }.ObterTodos(); UtilCreatePanel.CreateSupportPanel(supports, uiFlowPanel, support_Click); }
private void uiTxtSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab) { if (uiTxtSearch.TextLength == 11) { if (UtilValidar.validarCPF(uiTxtSearch.Text)) { currentCustomerFisico = new CustomerFisico() { CPF = uiTxtSearch.Text }.ObterPorCPF(); if (currentCustomerFisico != null) { UtilCreatePanel.CreateCustomerFPanel(currentCustomerFisico, uiFlowPanel, Customer_Click); flowPanelCustomerF.Visible = false; } else { new Alert("Não possui cliente com o CPF inserido.", uiCSB.Toastr.Type.Warning); uiTxtSearch.Text = string.Empty; } } else { new Alert("O CPF inserido é inválido.", uiCSB.Toastr.Type.Warning); uiTxtSearch.Text = string.Empty; } } else if (uiTxtSearch.TextLength == 14) { if (UtilValidar.validarCNPJ(uiTxtSearch.Text)) { currentCustomerJuridico = new CustomerJuridico() { CNPJ = uiTxtSearch.Text }.ObterPorCNPJ(); if (currentCustomerJuridico != null) { } else { new Alert("Não possui cliente com o CNPJ inserido.", uiCSB.Toastr.Type.Warning); uiTxtSearch.Text = string.Empty; } } else { new Alert("O CNPJ inserido é inválido.", uiCSB.Toastr.Type.Warning); uiTxtSearch.Text = string.Empty; } } } }
private void uiTxtSearch_TextChanged(object sender, EventArgs e) { uiFlowPanel.Controls.Clear(); currentCustomerJuridico = null; currentCustomerFisico = null; if (uiTxtSearch.TextLength == 11) { if (UtilValidar.validarCPF(uiTxtSearch.Text)) { currentCustomerFisico = new CustomerFisico() { CPF = uiTxtSearch.Text }.ObterPorCPF(); if (currentCustomerFisico != null) { UtilCreatePanel.CreateCustomerFPanel(currentCustomerFisico, uiFlowPanel, Customer_Click); flowPanelCustomerF.Visible = false; } else { new Alert("Não possui cliente com o CPF inserido.", uiCSB.Toastr.Type.Warning); } } } else if (uiTxtSearch.TextLength == 14) { if (UtilValidar.validarCNPJ(uiTxtSearch.Text)) { currentCustomerJuridico = new CustomerJuridico() { CNPJ = uiTxtSearch.Text }.ObterPorCNPJ(); if (currentCustomerJuridico != null) { UtilCreatePanel.CreateCustomerJPanel(currentCustomerJuridico, uiFlowPanel, Customer_Click); flowPanelCustomerJ.Visible = false; } else { new Alert("Não possui cliente com o CNPJ inserido.", uiCSB.Toastr.Type.Warning); uiTxtSearch.Text = string.Empty; } } else { new Alert("O CNPJ inserido é inválido.", uiCSB.Toastr.Type.Warning); uiTxtSearch.Text = string.Empty; uiTxtSearch.Focus(); } } }
private void ObterCriptomoedas() { List <Cryptocurency> cryptocurencies = new Cryptocurency { }.ObterTodos(); for (int i = 0; i < uiFlowPanel.Controls.Count; i++) { uiFlowPanel.Controls.RemoveAt(i); } UtilCreatePanel.CreateCryptocurrencyPanel(cryptocurencies, uiFlowPanel, Cryptocurrency_Click); }
private void ObterFuncionarios() { List <Employee> employee = new Employee { }.ObterDescadastrados(); for (int i = 0; i < uiFlowPanel.Controls.Count; i++) { uiFlowPanel.Controls.RemoveAt(i); } for (int i = 0; i < employee.Count; i++) { UtilCreatePanel.CreateUserPanel(employee[i], uiFlowPanel, Employee_Click); } }
private void uctFuncionario_Load(object sender, EventArgs e) { uiTxtCPF.ReadOnly = false; List <Employee> employee = new Employee { }.ObterTodos(); for (int i = 1; i < uiFlowPanel.Controls.Count; i++) { uiFlowPanel.Controls.RemoveAt(i); } for (int i = 0; i < employee.Count; i++) { UtilCreatePanel.CreateUserPanel(employee[i], uiFlowPanel, Employee_Click); } }