示例#1
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (PitinBindingSource.Current == null)
            {
                return;
            }

            if (MessageBox.Show("Are you sure you want to delete?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                modified = false;
                newRec   = false;
                PitinBindingSource.RemoveCurrent();
                errorProvider1.Clear();
                context.SaveChanges();
                setReadOnly(true);
                dATEDateEdit.Properties.ReadOnly = true;
                panelControlStatus.Visible       = true;
                LabelStatus.Text         = "Record Deleted";
                rowStatusDelete          = new Timer();
                rowStatusDelete.Interval = 3000;
                rowStatusDelete.Start();
                rowStatusDelete.Tick += new EventHandler(TimedEventDelete);
            }
            currentVal = ImageComboBoxEditCode.Text;
        }
示例#2
0
 private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e)
 {
     if (move())
     {
         PitinBindingSource.MoveLast();
     }
 }
示例#3
0
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            if (PitinBindingSource.Current == null)
            {
                PitinBindingSource.AddNew();
                ImageComboBoxEditCode.Focus();
                setReadOnly(false);

                newRec = true;
                return;
            }
            ImageComboBoxEditCode.Focus();
            //bindingNavigatorPositionItem.Focus();  //trigger field leave event
            temp = newRec;
            if (checkForms())
            {
                if (!temp)
                {
                    context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, ( PITIN)PitinBindingSource.Current);
                }
                PitinBindingSource.AddNew();
                ImageComboBoxEditCode.Focus();
                setReadOnly(false);


                newRec = true;
            }
        }
示例#4
0
 private void cPRATEBindingNavigatorSaveItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to save these changes?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         gridView2.MoveFirst();
         gridView2.MoveLast();
         PitinBindingSource.EndEdit();
         context.SaveChanges();
         panelControlStatus.Visible = true;
         LabelStatus.Text           = "Record Saved";
         rowStatusSave          = new Timer();
         rowStatusSave.Interval = 3000;
         rowStatusSave.Start();
         rowStatusSave.Tick += TimedEventSave;
     }
 }