private void txtNomF_LostFocus(object sender, EventArgs e) { if (txtNomF.ForeColor == Color.DarkGray) { bmb.CancelCurrentEdit(); btnNew.Enabled = true; btn_add.Enabled = false; foreach (Control c in groupBox1.Controls) { if (c is TextBox) { var text = (TextBox)c; text.ForeColor = Color.Black; } } dt.Rows.RemoveAt(dt.Rows.Count - 1); } else { foreach (Control c in groupBox1.Controls) { if (c is TextBox) { var text = (TextBox)c; text.ForeColor = Color.Black; } } } }
private void btnHuy_Click(object sender, EventArgs e) { DSNCC.CancelCurrentEdit(); tblNCC.RejectChanges(); capNhat = false; enabledButton(); }
private void btnHuy_Click(object sender, EventArgs e) { DSSV.CancelCurrentEdit(); tblSinhVien.RejectChanges(); enabledNutLenh(false); capNhat = false; }
private void btnHuy_Click(object sender, EventArgs e) { SACH.CancelCurrentEdit(); tblSACH.RejectChanges(); capnhat = false; enaButton(); }
private void btnHuy_Click(object sender, EventArgs e) { bindKH.CancelCurrentEdit(); tblKHACHHANG.RejectChanges(); capnhat = false; enablebutton(); }
private void btnHuy_Click(object sender, EventArgs e) { DSLSP.CancelCurrentEdit(); tblLoaiSP.RejectChanges(); capnhat = false; enableButton(); }
private void dataGridViewtiendodean_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex == 7) { btiendodean.EndCurrentEdit(); try { if (tiendodean.ghi()) { MessageBox.Show("Lưu thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (SqlException ex) { MessageBox.Show(ex.ToString(), "lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (e.RowIndex >= 0 && (e.ColumnIndex == 4 || e.ColumnIndex == 5 || e.ColumnIndex == 6)) { if (Convert.ToDateTime(tiendodean.Rows[e.RowIndex]["THOIGIANKETTHUC"]) < dateTimePicker1.Value) { btiendodean.CancelCurrentEdit(); MessageBox.Show("Quá ngày cập nhật tiến độ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void btnKhongGhi_Click(object sender, EventArgs e) { DS_BANDOC.CancelCurrentEdit(); Bang_BANDOC.RejectChanges(); An_hien_nut_lenh(false); cap_nhat = false; }
private void tolSpCannel_Click(object sender, EventArgs e) { DSNV.CancelCurrentEdit(); tblNhanVien.RejectChanges(); capNhat = false; enableButton(); }
private void btnCancel_Click(object sender, EventArgs e) { DS.CancelCurrentEdit(); tblSanPham.RejectChanges(); enableNutLenh(true); update = false; }
private void btKhongGhi_Click(object sender, EventArgs e) { DS_MUON_SACH.CancelCurrentEdit(); bang_MUONSACH.RejectChanges(); An_hien_nut_lenh(false); dNgayTra.Enabled = false; dNgayMuon.Enabled = true; }
private void btnCancel_Click(object sender, EventArgs e) { ChangeSet changeSet = db.GetChangeSet(); db.Refresh(RefreshMode.OverwriteCurrentValues, changeSet.Updates); listProductCategory.CancelCurrentEdit(); NormalInterface = true; }
private void rbtn_Huy_Click(object sender, EventArgs e) { DSSV.CancelCurrentEdit(); ChangeSet cs = db.GetChangeSet(); db.Refresh(RefreshMode.OverwriteCurrentValues, cs.Updates); enableNutLenh(false); }
private void bthuy_Click(object sender, EventArgs e) { nhanvien.CancelCurrentEdit(); tbnhanvien.RejectChanges(); nhanvien.Position = nhanvien.Position; bthuy.Enabled = false; btluu.Enabled = false; }
private void btnCancel_Click(object sender, EventArgs e) { bindCTHD.CancelCurrentEdit(); tblCTHD.RejectChanges(); bindDH.CancelCurrentEdit(); tblDONHANG.RejectChanges(); bdHD_PositionChanged(sender, e); capnhat = false; enableButton(); }
private void bntKhongGhi_Click(object sender, EventArgs e) { bindCTDB.CancelCurrentEdit(); tblCTDATBAO.RejectChanges(); bindPDB.CancelCurrentEdit(); tblPHIEUDATBAO.RejectChanges(); bdPDB_PositionChanged(sender, e); capNhat = false; ennableButton(); }
private void bthuy_Click(object sender, EventArgs e) { nhanvien.CancelCurrentEdit(); tbnhanvien.RejectChanges(); nhanvien.Position = nhanvien.Position; capnhat = false; enablebuton(capnhat); btsua.Enabled = true; btxoa.Enabled = true; }
private void btnHuy_Click(object sender, EventArgs e) { bindCTHD.CancelCurrentEdit(); tblCTHD.RejectChanges(); bindHD.CancelCurrentEdit(); tblHOADON.RejectChanges(); bdHD_PositionChanged(sender, e); capnhat = false; enaButton(); }
public virtual void PerformAction(ActionType action) { if (CurrencyManager == null && CurrencyManager.Count > 0) { return; } switch (action) { case ActionType.None: break; case ActionType.First: CurrencyManager.Position = 0; break; case ActionType.Prev: if (CurrencyManager.Position > 0) { CurrencyManager.Position--; } break; case ActionType.Next: if (CurrencyManager.Position < CurrencyManager.Count - 1) { CurrencyManager.Position++; } break; case ActionType.Last: CurrencyManager.Position = CurrencyManager.Count - 1; break; case ActionType.Add: CurrencyManager.AddNew(); break; case ActionType.Delete: CurrencyManager.RemoveAt(CurrencyManager.Position); break; case ActionType.EndEdit: CurrencyManager.EndCurrentEdit(); break; case ActionType.CancelEdit: CurrencyManager.CancelCurrentEdit(); break; default: throw new NotSupportedException(); } }
private void dataGridViewtiendodean_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex == 7) { btiendodean.EndCurrentEdit(); tiendodean.ghi(); } if (e.RowIndex >= 0 && (e.ColumnIndex == 4 || e.ColumnIndex == 5 || e.ColumnIndex == 6)) { if (Convert.ToDateTime(tiendodean.Rows[e.RowIndex]["THOIGIANKETTHUC"]) < dateTimePicker1.Value) { btiendodean.CancelCurrentEdit(); MessageBox.Show("Quá ngày cập nhật tiến độ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
//<snippet1> private void CancelEdit() { // Gets the CurrencyManager which is returned when the // data source is a DataView. BindingManagerBase myMgr = (CurrencyManager)BindingContext[myDataView]; // Gets the current row and changes a value. Then cancels the // edit and thereby discards the changes. DataRowView tempRowView = (DataRowView)myMgr.Current; Console.WriteLine("Original: {0}", tempRowView["myCol"]); tempRowView["myCol"] = "These changes will be discarded"; Console.WriteLine("Edit: {0}", tempRowView["myCol"]); myMgr.CancelCurrentEdit(); Console.WriteLine("After CanceCurrentlEdit: {0}", tempRowView["myCol"]); }
public override void Cancel() { foreach (DataView dv in MyACE.relTables.Values) { BindingManagerBase bc = this.BindingContext[dv]; bc.CancelCurrentEdit(); DataTable dt = dv.Table; if (dt.HasErrors) { foreach (DataRow dr in dt.GetErrors()) { dr.ClearErrors(); } } dt.RejectChanges(); } ApplyBR(true); }
private void button2_Click(object sender, EventArgs e) { bindkh.CancelCurrentEdit(); tblKHACHHANG.RejectChanges(); }
private void btnHuy_Click(object sender, EventArgs e) { DSSV.CancelCurrentEdit(); BangSinhVien.RejectChanges(); BatNutLenh(false); }
private void btnKhongGhi_Click(object sender, EventArgs e) { DS_SACH.CancelCurrentEdit(); Bang_SACH.RejectChanges(); An_hien_nut_lenh(false); }
private void btnHuy_Click(object sender, EventArgs e) { DSSV.CancelCurrentEdit(); Bang_SINHVIEN.RejectChanges(); enableNutLenh(false); }