private void tolSpSave_Click(object sender, EventArgs e) { try { DSNV.EndCurrentEdit(); daNhanVien.Update(tblNhanVien); tblNhanVien.AcceptChanges(); capNhat = false; enableButton(); } catch (Exception ex) { tblNhanVien.RejectChanges(); MessageBox.Show(ex.Message); } }
private void btnLuu_Click(object sender, EventArgs e) { try { bindKH.EndCurrentEdit(); daKH.Update(tblKHACHHANG); tblKHACHHANG.AcceptChanges(); MessageBox.Show("Lưu thành công!!!"); capnhat = false; enablebutton(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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); } } }
private void btnLuu_Click(object sender, EventArgs e) { try { DSCTPM.EndCurrentEdit(); daCTPM.Update(tblCTPhieuMuon); tblCTPhieuMuon.AcceptChanges(); MessageBox.Show("Cập nhật thành công!"); capNhat = false; enabledButton(); } catch { MessageBox.Show("Cập nhật thất bại!"); cbMaPM.Focus(); } }
private void btnLuu_Click(object sender, EventArgs e) { try { DSNCC.EndCurrentEdit(); daNCC.Update(tblNCC); tblNCC.AcceptChanges(); MessageBox.Show("Cập nhật thành công!"); capNhat = false; enabledButton(); } catch { MessageBox.Show("Cập nhật thất bại!"); txtMaNCC.Focus(); } }
private void btnSave_Click(object sender, System.EventArgs e) { try { bmb.EndCurrentEdit(); da.Update(ds, "管理员"); this.ds.Clear(); da.Fill(this.ds, "管理员"); bmb = this.BindingContext[ds, "管理员"]; this.label6.Text = "当前记录:" + (this.dataGrid1.CurrentRowIndex + 1); this.label7.Text = "记录数:" + this.bmb.Count; MessageBox.Show("数据修改成功"); } catch (Exception ex) { MessageBox.Show("修改失败:" + ex.Message.ToString()); } }
private void EndEdit() { // 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 ends the // edit and thereby keeps the changes. DataRowView tempRowView = (DataRowView)myMgr.Current; Console.WriteLine("Original: {0}", tempRowView["myCol"]); tempRowView["myCol"] = "These changes will be kept"; Console.WriteLine("Edit: {0}", tempRowView["myCol"]); myMgr.EndCurrentEdit(); Console.WriteLine("After EndCurrentEdit: {0}", tempRowView["myCol"]); }
private void btnAjouter_Click(object sender, EventArgs e) { if (textMontant.Text != "" && comboNumCompte.Text != "" && comboTypeMouvement.Text != "") { DvCompte = new DataView(Ds_Banque.Tables["Comptes"], "Num_Compte=" + comboNumCompte.SelectedValue, "", DataViewRowState.CurrentRows); textDateMouvement.Text = DateTime.Now.ToString(); if (comboTypeMouvement.Text == "Retrait" && Convert.ToDecimal(DvCompte[0]["Solde"]) <= Convert.ToDecimal(textMontant.Text)) { MessageBox.Show("Solde inssuffissant"); } else { try { DvCompte[0].BeginEdit(); if (comboTypeMouvement.Text == "Retrait") { DvCompte[0]["Solde"] = Convert.ToDecimal(DvCompte[0]["Solde"]) - Convert.ToDecimal(textMontant.Text); } else { DvCompte[0]["Solde"] = Convert.ToDecimal(DvCompte[0]["Solde"]) + Convert.ToDecimal(textMontant.Text); } DvCompte[0].EndEdit(); bmbMouvement.EndCurrentEdit(); BL = true; dataGridView1.Refresh(); MessageBox.Show("Mouvement inséré", "Ajout Mouvement", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Ajout effectué"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } else { MessageBox.Show("remplir les champs!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnSave_Click(object sender, EventArgs e) { if (txtName.Text.Length == 0) { MessageBox.Show("Tên không được trống!", "Thông báo"); return; } try { listProductCategory.EndCurrentEdit(); db.SubmitChanges(); XtraMessageBox.Show("Lưu vào CSDL thành công", "Thông báo"); } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } // Interface NormalInterface = true; }
private void btnSave_Click(object sender, EventArgs e) { if (txtPassword.Text.Length < 6) { MessageBox.Show("Mật khẩu phải từ 6 kí tự trở lên!", "Thông báo"); return; } try { listAdminAccount.EndCurrentEdit(); db.SubmitChanges(); XtraMessageBox.Show("Lưu vào CSDL thành công", "Thông báo"); } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } // Interface NormalInterface = true; }
private void btnAjouter_Click(object sender, EventArgs e) { if (textMontantVirement.Text != "" && comboCrediteur.Text != "" && combo_Num_Debiteur.Text != "") { if (soldeDebiteur < Convert.ToDecimal(textMontantVirement.Text)) { MessageBox.Show("Solde inssuffissant"); } else { try { DataRow ligne = Ds_Banque.Tables["Virements"].NewRow(); Dv_Compte[0].BeginEdit(); Dv_Compte[0]["Solde"] = soldeDebiteur - Convert.ToDecimal(textMontantVirement.Text); Dv_Compte[0].EndEdit(); Dv_Compte = new DataView(Ds_Banque.Tables["Comptes"], "Num_Compte =" + comboCrediteur.SelectedValue, "", DataViewRowState.CurrentRows); soldeCrediteur = Convert.ToDecimal(Dv_Compte[0]["Solde"]); Dv_Compte[0].BeginEdit(); Dv_Compte[0]["Solde"] = soldeCrediteur + Convert.ToDecimal(textMontantVirement.Text); Dv_Compte[0].EndEdit(); bmbVirement.EndCurrentEdit(); BL = true; dataGridView1.Refresh(); MessageBox.Show("Virement inséré", "Ajout Virement", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Ajout effectué"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } else { MessageBox.Show("remplir les champs!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnadd_Click(object sender, EventArgs e) { if (txtdes.Text == string.Empty || txtid.Text == string.Empty) { MessageBox.Show("ينبغي تسجيل المعلومات المطلوبه ", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } bmb.EndCurrentEdit(); cmdbd = new SqlCommandBuilder(da); da.Update(dt); MessageBox.Show("تمت عمليه الاضافه", "اضافه", MessageBoxButtons.OK, MessageBoxIcon.Information); btnadd.Enabled = false; btnnew.Enabled = true; label3.Text = (bmb.Position + 1) + "/" + bmb.Count; }
private void tolSpSave_Click(object sender, EventArgs e) { // chay thu di try { DSHD.EndCurrentEdit(); dahd.Update(tblhoadon); tblhoadon.AcceptChanges(); DSCTHD.EndCurrentEdit(); daCTHD.Update(tblCTHD); tblCTHD.AcceptChanges(); capNhat = false; enableButton(); } catch (Exception ex) { tblCTHD.RejectChanges(); MessageBox.Show(ex.Message); } }
private void btnLuu_Click(object sender, EventArgs e) { try { bindHD.EndCurrentEdit(); daHD.Update(tblHOADON); tblHOADON.AcceptChanges(); bindCTHD.EndCurrentEdit(); daCTHD.Update(tblCTHD); tblCTHD.AcceptChanges(); MessageBox.Show("Cập Nhật Thành Công!!!"); capnhat = false; enaButton(); } catch (SqlException ex) { tblCTHD.RejectChanges(); tblHOADON.RejectChanges(); MessageBox.Show(ex.ToString()); } }
private void bntGhi_Click(object sender, EventArgs e) { if (cbSDT.SelectedIndex == -1) { MessageBox.Show("chia chon khach hang "); return; } try { bindPDB.EndCurrentEdit(); daPDB.Update(tblCTDATBAO); tblCTDATBAO.AcceptChanges(); MessageBox.Show("cập nhật thành công"); capNhat = false; ennableButton(); } catch (SqlException ex) { tblCTDATBAO.RejectChanges(); tblPHIEUDATBAO.RejectChanges(); MessageBox.Show(ex.ToString()); } }
private void button1_Click(object sender, EventArgs e) { //MemoryStream stream = new MemoryStream(); //if (phanbiet == 1) { ////pbxhinh.Image.Save(stream, ImageFormat.Jpeg); //pbxhinh.Image.Save(stream, ImageFormat.Png); //nhanvien.EndCurrentEdit(); //TBL_NHANVIEN a = new TBL_NHANVIEN(); //a.MANV = tbxmanhanvien.Text; //a.TENNHANVIEN = tbxtenhanvien.Text; //a.DIACHI = tbxdiachi.Text; //a.NGAYSINH = dateTimePickerngaysinh.Value; //a.LUONG = double.Parse(tbxluong.Text); //a.CHUCVU = cbxchucvu.SelectedItem.ToString(); //a.HINH = stream.ToArray(); //db.TBL_NHANVIENs.InsertOnSubmit(a); //db.SubmitChanges(); //MessageBox.Show("Thêm thành công!!!"); //phanbiet = 0; string gioitinh = ""; if (tbxtenhanvien.Text == null || tbxdiachi.Text == null || tbxluong.Text == null || cbxchucvu.SelectedIndex == -1) { MessageBox.Show("Thông tin còn thiếu !!!"); } nhanvien.EndCurrentEdit(); if (radioButtonnam.Checked == true) { gioitinh = "Nam"; } if (radioButtonnu.Checked == true) { gioitinh = "Nữ "; } DataRow[] r = tbnhanv.Select("MANV='" + tbxmnv.Text + "'"); r[0]["GIOITINH"] = gioitinh.ToString(); try { if (tbnhanv.ghi() == true) { MessageBox.Show("Lưu thành công"); } } catch (SqlException ex) { MessageBox.Show(ex.ToString(), "lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } //if(phanbiet==-1) //{ // pbxhinh.Image.Save(stream, ImageFormat.Jpeg); // pbxhinh.Image.Save(stream, ImageFormat.Png); // TBL_NHANVIEN d = new TBL_NHANVIEN(); // d = (TBL_NHANVIEN)nhanvien.Current; // TBL_NHANVIEN t = new TBL_NHANVIEN(); // nhanvien.EndCurrentEdit(); // t = db.TBL_NHANVIENs.Single(p => p.MANV.Equals(tbxmanhanvien.Text)); // { // t.TENNHANVIEN = tbxtenhanvien.Text; // t.DIACHI = tbxdiachi.Text; // t.NGAYSINH = dateTimePickerngaysinh.Value; // t.LUONG = double.Parse(tbxluong.Text); // t.CHUCVU = cbxchucvu.SelectedItem.ToString(); // t.HINH = stream.ToArray(); // db.SubmitChanges(); // MessageBox.Show("sửa thành công!!!"); // phanbiet = 0; // } //} }
/// <summary> /// End the updating for this panel /// </summary> public void EndUpdating() { BindingManagerBase mgr = this.BindingContext[_timesheetrow]; mgr.EndCurrentEdit(); }
private void button1_Click(object sender, EventArgs e) { BmbBq.EndCurrentEdit(); BL = true; dataGridView3.Refresh(); }
private void myMemoEdit1_EditValueChanged_1(object sender, EventArgs e) { BindingManagerBase Manager = BindingContext[DT]; Manager.EndCurrentEdit(); }