Example #1
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (DigHdrBindingSource.Current == null)
            {
                return;
            }
            gridView1.CloseEditor();
            if (MessageBox.Show("Are you sure you want to delete?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                modified = false;
                newRec   = false;
                DigHdrBindingSource.RemoveCurrent();
                errorProvider1.Clear();
                context.SaveChanges();
                agencySearch.ButtonEdit.Properties.ReadOnly = true;
                cOUP_RESTextEdit.Properties.ReadOnly        = true;
                panelControlStatus.Visible = true;
                LabelStatus.Text           = "Record Deleted";
                rowStatusDelete            = new Timer();
                rowStatusDelete.Interval   = 3000;
                rowStatusDelete.Start();
                rowStatusDelete.Tick += new EventHandler(TimedEventDelete);
            }

            agencySearch.Focus();
        }
Example #2
0
 private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e)
 {
     if (move())
     {
         DigHdrBindingSource.MoveLast();
     }
 }
Example #3
0
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            if (DigHdrBindingSource.Current == null)
            {
                DigHdrBindingSource.AddNew();

                agencySearch.Focus();
                agencySearch.ButtonEdit.Properties.ReadOnly = false;
                cOUP_RESTextEdit.Properties.ReadOnly        = false;
                newRec = true;
                return;
            }
            agencySearch.Focus();
            //bindingNavigatorPositionItem.Focus();  //trigger field leave event
            gridView1.CloseEditor();
            temp = newRec;

            if (checkForms())
            {
                errorProvider1.Clear();
                if (!temp)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (DIGHDR)DigHdrBindingSource.Current);
                }
                DigHdrBindingSource.AddNew();
                agencySearch.Focus();
                agencySearch.ButtonEdit.Properties.ReadOnly = false;
                cOUP_RESTextEdit.Properties.ReadOnly        = false;
                newRec = true;
            }
        }