/// <summary> /// 记录属性。 /// </summary> protected void DocProperty() { int rowIndex = -1; if (!(dgvDocList.CurrentRow == null)) { rowIndex = dgvDocList.CurrentCell.RowIndex; } else { return; } if (rowIndex < 0) { return; } DataGridViewRow row = dgvDocList.Rows[rowIndex]; //HYPDM.Entities.PDM_DOCUMENT document = row.DataBoundItem as HYPDM.Entities.PDM_DOCUMENT; //初始化属性值 HYPDM.Entities.PDM_DRAWING document = new PDM_DRAWING(); document.DOCID = row.Cells["DOCID"].Value.ToString(); document.DOCNAME = row.Cells["DOCNAME"].Value.ToString(); document.DOCNO = row.Cells["DOCNO"].Value.ToString(); document.DOCSTATUS = row.Cells["DOCSTATUS"].Value.ToString(); document.DOCTYPE = row.Cells["DOCTYPE"].Value.ToString(); document.REMARK = row.Cells["REMARK"].Value.ToString(); document.VERSION = row.Cells["VERSION"].Value.ToString(); document.LASTUPDATEDATE = row.Cells["LASTUPDATEDATE"].Value.ToString(); document.LASTUPDATEUSER = row.Cells["LASTUPDATEUSER"].Value.ToString(); document.CREATEDATE = row.Cells["CREATEDATE"].Value.ToString(); document.DESCRIPTION = row.Cells["DESCRIPTION"].Value.ToString(); document.CREATEUSER = row.Cells["CREATEUSER"].Value.ToString(); document.DEL_FLAG = row.Cells["DEL_FLAG"].Value.ToString(); if (document == null) { return; } HYPDM.WinUI.DrawingDocument.DrawRegForm o = new HYPDM.WinUI.DrawingDocument.DrawRegForm(); o.Document = document; if (o.ShowDialog() == DialogResult.OK) { HYPDM.Entities.PDM_DRAWING doc = o.Document; //更新当前记录 //row.Cells["DOCID"].Value = document.DOCID; row.Cells["DOCNAME"].Value = document.DOCNAME; row.Cells["DOCNO"].Value = document.DOCNO; row.Cells["DOCSTATUS"].Value = document.DOCSTATUS; row.Cells["DOCTYPE"].Value = document.DOCTYPE; row.Cells["REMARK"].Value = document.REMARK; row.Cells["VERSION"].Value = document.VERSION; row.Cells["LASTUPDATEDATE"].Value = document.LASTUPDATEDATE; row.Cells["LASTUPDATEUSER"].Value = document.LASTUPDATEUSER; row.Cells["CREATEDATE"].Value = document.CREATEDATE; row.Cells["DESCRIPTION"].Value = document.DESCRIPTION; row.Cells["CREATEUSER"].Value = document.CREATEUSER; row.Cells["DEL_FLAG"].Value = document.DEL_FLAG; // this.InitList(); BindDataFile(); } }
/// <summary> /// 记录属性。 /// </summary> protected void DocProperty() { int rowIndex = -1; if (!(dgvDocList.CurrentRow == null)) { rowIndex = dgvDocList.CurrentCell.RowIndex; } else { return; } if (rowIndex < 0) return; DataGridViewRow row = dgvDocList.Rows[rowIndex]; //HYPDM.Entities.PDM_DOCUMENT document = row.DataBoundItem as HYPDM.Entities.PDM_DOCUMENT; //初始化属性值 HYPDM.Entities.PDM_DRAWING document = new PDM_DRAWING(); document.DOCID = row.Cells["DOCID"].Value.ToString(); document.DOCNAME = row.Cells["DOCNAME"].Value.ToString(); document.DOCNO = row.Cells["DOCNO"].Value.ToString(); document.DOCSTATUS = row.Cells["DOCSTATUS"].Value.ToString(); document.DOCTYPE = row.Cells["DOCTYPE"].Value.ToString(); document.REMARK = row.Cells["REMARK"].Value.ToString(); document.VERSION = row.Cells["VERSION"].Value.ToString(); document.LASTUPDATEDATE = row.Cells["LASTUPDATEDATE"].Value.ToString(); document.LASTUPDATEUSER = row.Cells["LASTUPDATEUSER"].Value.ToString(); document.CREATEDATE = row.Cells["CREATEDATE"].Value.ToString(); document.DESCRIPTION = row.Cells["DESCRIPTION"].Value.ToString(); document.CREATEUSER = row.Cells["CREATEUSER"].Value.ToString(); document.DEL_FLAG = row.Cells["DEL_FLAG"].Value.ToString(); if (document == null) return; HYPDM.WinUI.DrawingDocument.DrawRegForm o = new HYPDM.WinUI.DrawingDocument.DrawRegForm(); o.Document = document; if (o.ShowDialog() == DialogResult.OK) { HYPDM.Entities.PDM_DRAWING doc = o.Document; //更新当前记录 //row.Cells["DOCID"].Value = document.DOCID; row.Cells["DOCNAME"].Value=document.DOCNAME; row.Cells["DOCNO"].Value=document.DOCNO; row.Cells["DOCSTATUS"].Value=document.DOCSTATUS; row.Cells["DOCTYPE"].Value=document.DOCTYPE; row.Cells["REMARK"].Value=document.REMARK; row.Cells["VERSION"].Value=document.VERSION; row.Cells["LASTUPDATEDATE"].Value=document.LASTUPDATEDATE; row.Cells["LASTUPDATEUSER"].Value=document.LASTUPDATEUSER; row.Cells["CREATEDATE"].Value=document.CREATEDATE; row.Cells["DESCRIPTION"].Value=document.DESCRIPTION; row.Cells["CREATEUSER"].Value=document.CREATEUSER; row.Cells["DEL_FLAG"].Value=document.DEL_FLAG; // this.InitList(); BindDataFile(); } }