private void gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { int ctcdtID = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[0]); int cdtID = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[1]); int chiphitcID = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[2]); string ngay = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[3]).ToString(); DateTime dt = DateTime.Parse(ngay, new CultureInfo("en-CA")); string tenCa = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[4]).ToString(); string tenCDT = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[5]).ToString(); float sotienlay = float.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[6]).ToString()); try { if (MessageBox.Show(" Bạn có muốn Update CDT: '" + tenCDT + "' '" + dt.ToString("d/M/yyyy") + "', thuộc '" + tenCa + "' không?", "Thông Báo!", MessageBoxButtons.YesNo) == DialogResult.Yes) { string query1 = "exec [dbo].[proc_UpdateCDT_CPTheoCa] @ctcdtID , @cdtID , @chiphitcID , @sotienlay "; DataProvider.Instance.ExecuteQuery(query1, new object[] { ctcdtID, cdtID, chiphitcID, sotienlay.ToString() }); AutoCloseMessageBox.Show("Update CDT: '" + tenCDT + "' '" + dt.ToString("d/M/yyyy") + "', thuộc '" + tenCa + "' thành công!", "Thông Báo!!", 1000); } LoadCTCDT_CPTC(); } catch (SqlException ex) { MessageBox.Show("Lỗi không Update CDT: '" + tenCDT + "' '" + dt.ToString("d/M/yyyy") + "', thuộc '" + tenCa + "' được! Nếu có bất kỳ thắc mắc gì vui lòng liên hệ Trung sdt: 0902669115", "Lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { int id = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[0]); int doanhthuID = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[1]); string ngay = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[2]).ToString(); DateTime dt = DateTime.Parse(ngay, new CultureInfo("en-CA")); string tenCa = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[3]).ToString(); float tiendelai = float.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[4]).ToString()); float dttrongngay = float.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[5]).ToString()); float dtkhac = float.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[6]).ToString()); try { if (MessageBox.Show("update caID " + id + ", thuộc ngày " + dt.ToString("d/M/yyyy"), "Thông Báo!", MessageBoxButtons.YesNo) == DialogResult.Yes) { string query1 = "exec [dbo].[proc_UpdateDoanhThuTheoCa] @caID , @tenCa , @doanhthuID , @tiendelai , @doanhthutheoca , @doanhthukhac "; DataProvider.Instance.ExecuteQuery(query1, new object[] { id, tenCa, doanhthuID.ToString(), tiendelai.ToString(), dttrongngay.ToString(), dtkhac.ToString() }); AutoCloseMessageBox.Show("Update caID " + id + " thành công!", "Thông Báo!!", 1000); //DataProvider.Instance.UpdateDataDoanhThu(id, dt.ToString()); //LoadDoanhThu(); } //else //{ LoadDoanhThuTheoCa(); //} } catch (SqlException ex) { MessageBox.Show("Lỗi không update được " + id + ", thuộc ngày " + ngay + "! Nếu có bất kỳ thắc mắc gì vui lòng liên hệ Trung sdt: 0902669115", "Lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void edit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { string id = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[0]).ToString(); string tenCDT = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[5]).ToString(); string ngay = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[3]).ToString(); DateTime dt = DateTime.Parse(ngay, new CultureInfo("en-CA")); try { if (MessageBox.Show("Xóa '" + tenCDT + "', ngày '" + dt.ToString("d/M/yyyy") + "' ?", "Thông Báo!", MessageBoxButtons.YesNo) == DialogResult.Yes) { string query = "exec [dbo].[proc_DeleteCDT_CPTheoCa] @ctcdtID "; DataProvider.Instance.ExecuteQuery(query, new object[] { id }); AutoCloseMessageBox.Show("Xóa '" + tenCDT + "', ngày '" + dt.ToString("d/M/yyyy") + "' Thành công!", "Thông Báo!", 2500); LoadCTCDT_CPTC(); } } catch (SqlException ex) { MessageBox.Show("Lỗi không xóa được" + id + ",! Nếu có bất kỳ thắc mắc gì vui lòng liên hệ Trung sdt: 0902669115", "Lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void loader_Prompt(object sender, MessagePromptEventArgs e) { // TODO: 不再出现此对话框。不过重试有个次数限制,同一位置失败多次后总要出现对话框才好 if (e.Actions == "yes,no,cancel") { #if NO DialogResult result = MessageBox.Show(this, e.MessageText + "\r\n\r\n是否重试操作?\r\n\r\n(是: 重试; 否: 跳过本次操作,继续后面的操作; 取消: 停止全部操作)", "ReportForm", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (result == DialogResult.Yes) { e.ResultAction = "yes"; } else if (result == DialogResult.Cancel) { e.ResultAction = "cancel"; } else { e.ResultAction = "no"; } #endif DialogResult result = AutoCloseMessageBox.Show(this, e.MessageText + "\r\n\r\n将自动重试操作\r\n\r\n(点右上角关闭按钮可以中断批处理)", 20 * 1000, "OperLogStatisForm"); if (result == DialogResult.Cancel) { e.ResultAction = "no"; } else { e.ResultAction = "yes"; } } }
private void OpenServer(bool bDisplayErrorMessage = true) { string strError = ""; WriteHtml(this.webBrowser1, "<html><head></head><body>"); int nRet = this.StartChannel("ipc://FingerprintChannel/FingerprintServer", out strError); if (nRet == -1) { goto ERROR1; } nRet = this.m_fingerprintObj.Open(out strError); if (nRet == -1) { goto ERROR1; } this.m_fingerprintObj.SetParameter("Threshold", this.m_nThreshold); this.label_message.Text = ""; this.TopMost = false; return; ERROR1: /* * MessageBox.Show(this, strError, * "dp2-中控指纹阅读器接口", MessageBoxButtons.OK, MessageBoxIcon.Error); * */ if (bDisplayErrorMessage == true) { AutoCloseMessageBox.Show(this, strError, 10000, "dp2-中控指纹阅读器接口"); } this.EndChannel(); this.label_message.Text = strError; }
private void gridView2_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { int ctcdtID = (int)gridView2.GetRowCellValue(e.RowHandle, gridView2.Columns[0]); int cdtID = (int)gridView2.GetRowCellValue(e.RowHandle, gridView2.Columns[1]); int chiphitcID = (int)gridView2.GetRowCellValue(e.RowHandle, gridView2.Columns[2]); string tenCDT = gridView2.GetRowCellValue(e.RowHandle, gridView2.Columns[5]).ToString(); float sotienlay = float.Parse(gridView2.GetRowCellValue(e.RowHandle, gridView2.Columns[6]).ToString()); DialogResult res = MessageBox.Show("update so tiền:'" + sotienlay.ToString() + "' của tênCDT: '" + tenCDT + "'?", "Thông Báo!", MessageBoxButtons.YesNo); try { if (res == DialogResult.Yes) { string query1 = "exec [dbo].[proc_UpdateCDT_CPTheoCa] @ctcdtID , @cdtID , @chiphitcID , @sotienlay "; DataProvider.Instance.ExecuteQuery(query1, new object[] { ctcdtID, cdtID, chiphitcID, sotienlay.ToString() }); AutoCloseMessageBox.Show("Update so tiền:'" + sotienlay.ToString() + "' của tênCDT: '" + tenCDT + "' Thành công!", "Thông Báo!!", 1000); } } catch (SqlException ex) { MessageBox.Show("Lỗi không so tiền:'" + sotienlay.ToString() + "' của tênCDT: '" + tenCDT + "'?, Nếu có bất kỳ thắc mắc gì vui lòng liên hệ Trung sdt: 0902669115", "Lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//ok private void gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { int id = (int)gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns[0]); string tenCDT = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns[1]).ToString(); int sdtCDT = (int)gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns[2]); string diachiCDT = gridView1.GetRowCellValue(e.RowHandle, gridView1.Columns[3]).ToString(); DialogResult res = MessageBox.Show("update tênCDT " + tenCDT + ", có ID:" + id.ToString() + "", "Thông Báo!", MessageBoxButtons.YesNo); try { if (res == DialogResult.Yes) { string query1 = "exec [dbo].[proc_UpdateCDT] @cdtID , @tenCDT , @sdtCDT , @diachiCDT "; DataProvider.Instance.ExecuteQuery(query1, new object[] { id, tenCDT, sdtCDT.ToString(), diachiCDT }); AutoCloseMessageBox.Show("Update chủ đầu tư:'" + tenCDT + "' thành công!", "Thông Báo!!", 1000); } LoadCDT(); } catch (SqlException ex) { MessageBox.Show("Lỗi không update được " + id + ", Nếu có bất kỳ thắc mắc gì vui lòng liên hệ Trung sdt: 0902669115", "Lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }