/// <summary> /// 删除数据方法 /// </summary> /// <param name="id"></param> /// <returns></returns> private bool deleteData(decimal NODEMATERIALSNO) { try { BLL.STU_MATERIALS stu_materialsBll = new BLL.STU_MATERIALS(); BLL.NODEMATERIALS nodematerialsBll = new BLL.NODEMATERIALS(); Model.NODEMATERIALS nodematerialsMdl = new Model.NODEMATERIALS(); nodematerialsMdl = nodematerialsBll.GetModel(NODEMATERIALSNO); int nodeno = (int)nodematerialsMdl.NODENO; int materialno = (int)nodematerialsMdl.MATERIALNO; int recordCount = stu_materialsBll.GetRecordCount("and STU_MATERIALS.MATERIALNO = " + materialno.ToString() + " and STU_WORKFLOW.NODENO = " + nodeno.ToString()); if (recordCount > 0) { MessageBox.Show("该设置信息已经被使用,不能被删除!", "提示信息"); return(false); } else { nodematerialsBll.Delete(NODEMATERIALSNO); return(true); } } catch (Exception exception) { MessageBox.Show("删除失败!", exception.Message); return(false); } }
private void bbi_Turnover_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int id = 0; if (this.gridView2.RowCount <= 0) { return; } id = ToolHelper.ConvertToInt(this.gridView2.GetFocusedRowCellValue("TURNOVERNO").ToString()); if (id < 1) { MessageBox.Show("请选择需要提交的材料记录!", "提示信息"); return; } else { DateTime dt = DateTime.Now; BLL.STU_MATERIALS stumaterialsBll = new BLL.STU_MATERIALS(); stumaterialsBll.Update(id, dt); refresh_Materials(); } }
/// <summary> /// 刷新材料信息方法 /// </summary> private void refresh_Materials() { int id = 0; if (this.gridView1.RowCount <= 0) { return; } id = ToolHelper.ConvertToInt(this.gridView1.GetFocusedRowCellValue("EXECNO").ToString()); if (id < 1) { return; } else { BLL.STU_MATERIALS stumaterialsBll = new BLL.STU_MATERIALS(); this.gridControl2.DataSource = stumaterialsBll.GetList(" and A.EXECNO = " + id.ToString()).Tables[0]; this.gridView2.BestFitColumns(); DBUtility.ToolHelper.DrawRowIndicator(gridView2, 50); DBUtility.ToolHelper.SetLineColorofGridView(this.gridView2); } }