private void barButtonItem19_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ////// 检查是否 火化结算完成 ////// if (FireAction.FireIsSettled(AC001) == "1" && Envior.cur_userId != AppInfo.ROOTID) { XtraMessageBox.Show("火化业务已经办理并且结算,不能修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Frm_FireTime frm_1 = new Frm_FireTime(); if (frm_1.ShowDialog() != DialogResult.OK) { frm_1.Dispose(); return; } DateTime dt_fire = Convert.ToDateTime(frm_1.swapdata["AC015"]); //XtraMessageBox.Show(dt_fire.ToString("yyyy-MM-dd HH:mm")); if (FireAction.SetFireTime(AC001, dt_fire.ToString("yyyy-MM-dd HH:mm")) < 0) { return; } txtedit_ac015.EditValue = dt_fire; frm_1.Dispose(); }
/// <summary> /// 结算办理 /// </summary> private void SettleHandle() { //权限检查 if (!AppAction.CheckRight("火化业务结算")) { return; } if (gridView1.GetSelectedRows().Length <= 0) { XtraMessageBox.Show("请选择要结算的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } List <int> rowList = new List <int>(); //检查是否有未输入单价项目 for (int i = 0; i < gridView1.RowCount; i++) { if (!gridView1.IsRowSelected(i) || gridView1.GetRowCellValue(i, "SA008").ToString() == "1") { continue; } if (Convert.ToDecimal(gridView1.GetRowCellValue(i, "PRICE")) == 0) { XtraMessageBox.Show("第" + (i + 1).ToString() + "行项目未输入价格!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (gridView1.GetRowCellValue(i, "INVOICECODE") is DBNull) { XtraMessageBox.Show("第" + (i + 1).ToString() + "行项目未设置发票编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } rowList.Add(gridView1.GetDataSourceRowIndex(i)); } int i_find = gridView1.LocateByValue("SA002", "06"); if (i_find >= 0 && gridView1.IsRowSelected(i_find)) { if (SqlAssist.ExecuteScalar("select ac015 from ac01 where ac001= '" + AC001 + "'") is DBNull) { Frm_FireTime frm_1 = new Frm_FireTime(); if (frm_1.ShowDialog() != DialogResult.OK) { frm_1.Dispose(); return; } DateTime dt_fire = Convert.ToDateTime(frm_1.swapdata["AC015"]); if (FireAction.SetFireTime(AC001, dt_fire.ToString("yyyy-MM-dd HH:mm")) < 0) { return; } txtedit_ac015.EditValue = dt_fire; frm_1.Dispose(); } } Frm_FireSettle frm_settle = new Frm_FireSettle(); frm_settle.swapdata["dataset"] = business_ds; frm_settle.swapdata["AC001"] = AC001; frm_settle.swapdata["rowList"] = rowList; if (frm_settle.ShowDialog() == DialogResult.OK) { this.RefreshSalesData(); } frm_settle.Dispose(); CancelSelect(); }