Beispiel #1
0
        private void barBtnNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var xFrmCliFor = new XFrmContato();

            xFrmCliFor.ShowDialog();

            if (xFrmCliFor.IsUpdate)
            {
                this.contatos.Add(xFrmCliFor.Contato);
                gridView1.RefreshData();
            }
        }
Beispiel #2
0
        private void barBtnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.IsSelectOneRowWarning())
            {
                var c = gridView1.GetFocusedRow() as Contato;

                var frm = new XFrmContato(c);
                frm.ShowDialog();

                if (frm.IsUpdate)
                {
                    c.Update(frm.Contato);
                }
            }
        }