private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e) { if (move()) { InsuranBindingSource.MoveLast(); } }
private void cARRATEBindingNavigatorSaveItem_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(); InsuranBindingSource.EndEdit(); context.SaveChanges(); panelControlStatus.Visible = true; LabelStatus.Text = "Record Saved"; rowStatusSave = new Timer(); rowStatusSave.Interval = 3000; rowStatusSave.Start(); rowStatusSave.Tick += TimedEventSave; } }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { GridViewInsuran.ClearColumnsFilter(); if (InsuranBindingSource.Current == null) { //fake query in order to create a link between the database table and the binding source InsuranBindingSource.DataSource = from opt in context.INSURAN where opt.AGENCY == "KJM9" select opt; InsuranBindingSource.AddNew(); if (GridViewInsuran.FocusedRowHandle == GridControl.AutoFilterRowHandle) { GridViewInsuran.FocusedRowHandle = GridViewInsuran.RowCount - 1; } setValues(); setReadOnly(false); yEARComboBoxEdit.Focus(); newRec = true; return; } yEARComboBoxEdit.Focus(); //bindingNavigatorPositionItem.Focus(); //trigger field leave event GridViewInsuran.CloseEditor(); temp = newRec; if (checkForms()) { if (!temp) { context.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, ( INSURAN)InsuranBindingSource.Current); } InsuranBindingSource.AddNew(); if (GridViewInsuran.FocusedRowHandle == GridControl.AutoFilterRowHandle) { GridViewInsuran.FocusedRowHandle = GridViewInsuran.RowCount - 1; } setValues(); setReadOnly(false); yEARComboBoxEdit.Focus(); newRec = true; } }
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (InsuranBindingSource.Current == null) { return; } GridViewInsuran.CloseEditor(); if (MessageBox.Show("Are you sure you want to delete?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { modified = false; newRec = false; InsuranBindingSource.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); } currentVal = ImageComboBoxEditAgency.Text; }