Exemplo n.º 1
0
        public override int buscarRegistros()
        {
            TList_CadLocalArm lista = TCN_CadLocalArm.Busca(CD_Local.Text,
                                                            DS_Local.Text,
                                                            string.Empty,
                                                            string.Empty,
                                                            null);

            if (lista != null)
            {
                if (lista.Count > 0)
                {
                    this.Lista = lista;
                    BS_CadLocalArm.DataSource = lista;
                }
                else
                if ((vTP_Modo == TTpModo.tm_Standby) || (vTP_Modo == TTpModo.tm_busca))
                {
                    BS_CadLocalArm.Clear();
                }
                return(lista.Count);
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 2
0
 public override void afterCancela()
 {
     base.afterCancela();
     if (vTP_Modo == TTpModo.tm_Insert)
     {
         BS_CadLocalArm.RemoveCurrent();
     }
 }
Exemplo n.º 3
0
 public override void afterNovo()
 {
     if ((vTP_Modo == TTpModo.tm_busca) || (vTP_Modo == TTpModo.tm_Standby))
     {
         BS_CadLocalArm.AddNew();
         base.afterNovo();
         if (!CD_Local.Focus())
         {
             DS_Local.Focus();
         }
     }
 }
Exemplo n.º 4
0
 public override void excluirRegistro()
 {
     if (g_FCadLocalArm.RowCount > 0)
     {
         if ((this.vTP_Modo == TTpModo.tm_Standby) || (this.vTP_Modo == TTpModo.tm_busca))
         {
             if (MessageBox.Show("Confirma Exclusão do Registro?", "Mensagem",
                                 MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) ==
                 System.Windows.Forms.DialogResult.Yes)
             {
                 TCN_CadLocalArm.Excluir(BS_CadLocalArm.Current as TRegistro_CadLocalArm, null);
                 BS_CadLocalArm.RemoveCurrent();
                 pDados.LimparRegistro();
                 afterBusca();
             }
         }
     }
 }
Exemplo n.º 5
0
        private void g_FCadLocalArm_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (g_FCadLocalArm.Columns[e.ColumnIndex].SortMode == DataGridViewColumnSortMode.NotSortable)
            {
                return;
            }
            if (BS_CadLocalArm.Count < 1)
            {
                return;
            }
            PropertyDescriptorCollection lP = TypeDescriptor.GetProperties(new TRegistro_CadLocalArm());
            TList_CadLocalArm            lComparer;
            SortOrder direcao = SortOrder.None;

            if ((g_FCadLocalArm.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection == SortOrder.None) ||
                (g_FCadLocalArm.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection == SortOrder.Descending))
            {
                lComparer = new TList_CadLocalArm(lP.Find(g_FCadLocalArm.Columns[e.ColumnIndex].DataPropertyName, true), SortOrder.Ascending);
                foreach (DataGridViewColumn c in g_FCadLocalArm.Columns)
                {
                    c.HeaderCell.SortGlyphDirection = SortOrder.None;
                }
                direcao = SortOrder.Ascending;
            }
            else
            {
                lComparer = new TList_CadLocalArm(lP.Find(g_FCadLocalArm.Columns[e.ColumnIndex].DataPropertyName, true), SortOrder.Descending);
                foreach (DataGridViewColumn c in g_FCadLocalArm.Columns)
                {
                    c.HeaderCell.SortGlyphDirection = SortOrder.None;
                }
                direcao = SortOrder.Descending;
            }
            (BS_CadLocalArm.List as TList_CadLocalArm).Sort(lComparer);
            BS_CadLocalArm.ResetBindings(false);
            g_FCadLocalArm.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = direcao;
        }