Пример #1
0
 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;
             }
         }
     }
 }
Пример #2
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     DSNCC.CancelCurrentEdit();
     tblNCC.RejectChanges();
     capNhat = false;
     enabledButton();
 }
Пример #3
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     DSSV.CancelCurrentEdit();
     tblSinhVien.RejectChanges();
     enabledNutLenh(false);
     capNhat = false;
 }
Пример #4
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     SACH.CancelCurrentEdit();
     tblSACH.RejectChanges();
     capnhat = false;
     enaButton();
 }
Пример #5
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     bindKH.CancelCurrentEdit();
     tblKHACHHANG.RejectChanges();
     capnhat = false;
     enablebutton();
 }
Пример #6
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     DSLSP.CancelCurrentEdit();
     tblLoaiSP.RejectChanges();
     capnhat = false;
     enableButton();
 }
Пример #7
0
 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;
 }
Пример #9
0
 private void tolSpCannel_Click(object sender, EventArgs e)
 {
     DSNV.CancelCurrentEdit();
     tblNhanVien.RejectChanges();
     capNhat = false;
     enableButton();
 }
Пример #10
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     DS.CancelCurrentEdit();
     tblSanPham.RejectChanges();
     enableNutLenh(true);
     update = false;
 }
Пример #11
0
 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;
        }
Пример #13
0
        private void rbtn_Huy_Click(object sender, EventArgs e)
        {
            DSSV.CancelCurrentEdit();
            ChangeSet cs = db.GetChangeSet();

            db.Refresh(RefreshMode.OverwriteCurrentValues, cs.Updates);
            enableNutLenh(false);
        }
Пример #14
0
 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();
 }
Пример #16
0
 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;
 }
Пример #18
0
        private void btnHuy_Click(object sender, EventArgs e)
        {
            bindCTHD.CancelCurrentEdit();
            tblCTHD.RejectChanges();

            bindHD.CancelCurrentEdit();
            tblHOADON.RejectChanges();
            bdHD_PositionChanged(sender, e);
            capnhat = false;
            enaButton();
        }
Пример #19
0
        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();
            }
        }
Пример #20
0
 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);
         }
     }
 }
Пример #21
0
        //<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"]);
        }
Пример #22
0
        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);
        }
Пример #23
0
 private void button2_Click(object sender, EventArgs e)
 {
     bindkh.CancelCurrentEdit();
     tblKHACHHANG.RejectChanges();
 }
Пример #24
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     DSSV.CancelCurrentEdit();
     BangSinhVien.RejectChanges();
     BatNutLenh(false);
 }
Пример #25
0
 private void btnKhongGhi_Click(object sender, EventArgs e)
 {
     DS_SACH.CancelCurrentEdit();
     Bang_SACH.RejectChanges();
     An_hien_nut_lenh(false);
 }
Пример #26
0
 private void btnHuy_Click(object sender, EventArgs e)
 {
     DSSV.CancelCurrentEdit();
     Bang_SINHVIEN.RejectChanges();
     enableNutLenh(false);
 }