Ejemplo n.º 1
0
 private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e)
 {
     if (move())
     {
         CruItBindingSource.MoveLast();
     }
 }
Ejemplo n.º 2
0
 private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
 {
     GridViewCruIt.ClearColumnsFilter();
     if (CruItBindingSource.Current == null)
     {
         //fake query in order to create a link between the database table and the binding source
         CruItBindingSource.DataSource = from opt in context.CRUIT where opt.CODE == "KJM9" select opt;
         CruItBindingSource.AddNew();
         if (GridViewCruIt.FocusedRowHandle == GridControl.AutoFilterRowHandle)
         {
             GridViewCruIt.FocusedRowHandle = GridViewCruIt.RowCount - 1;
         }
         setValues();
         //codeSearch.Focus();
         setReadOnly(false);
         newRec = true;
         return;
     }
     ImageComboBoxEditCode.Focus();
     //bindingNavigatorPositionItem.Focus();  //trigger field leave event
     GridViewCruIt.CloseEditor();
     temp = newRec;
     if (checkForms())
     {
         if (!temp)
         {
             context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, (CRUIT)CruItBindingSource.Current);
         }
         CruItBindingSource.AddNew();
         if (GridViewCruIt.FocusedRowHandle == GridControl.AutoFilterRowHandle)
         {
             GridViewCruIt.FocusedRowHandle = GridViewCruIt.RowCount - 1;
         }
         setValues();
         //codeSearch.Focus();
         setReadOnly(false);
         newRec = true;
     }
 }
Ejemplo n.º 3
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (CruItBindingSource.Current == null)
     {
         return;
     }
     GridViewCruIt.CloseEditor();
     if (MessageBox.Show("Are you sure you want to delete?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         modified = false;
         newRec   = false;
         CruItBindingSource.RemoveCurrent();
         errorProvider1.Clear();
         context.SaveChanges();
         setReadOnly(true);
         panelControlStatus.Visible = true;
         LabelStatus.Text           = "Record Deleted";
         rowStatusDelete            = new Timer();
         rowStatusDelete.Interval   = 3000;
         rowStatusDelete.Start();
         rowStatusDelete.Tick += new EventHandler(TimedEventDelete);
     }
     //codeSearch.Focus();
 }