public static WcfClient.ParamsEntity paramsEntity(PDM_DRAWING obj) { WcfClient.ParamsEntity entity = new WcfClient.ParamsEntity(); entity.WcfAddr = "192.168.0.8"; entity.WcfPort = "8000"; entity.SockServerIP = "192.168.0.8"; entity.Port1 = 2005; entity.Port2 = 2006; entity.Port3 = 2007; entity.LoginID = UserName; entity.PdmDrawObj = obj; return entity; }
public static WcfClient.ParamsEntity paramsEntity(PDM_DRAWING obj) { WcfClient.ParamsEntity entity = new WcfClient.ParamsEntity(); entity.WcfAddr = "192.168.0.8"; entity.WcfPort = "8000"; entity.SockServerIP = "192.168.0.8"; entity.Port1 = 2005; entity.Port2 = 2006; entity.Port3 = 2007; entity.LoginID = UserName; entity.PdmDrawObj = obj; return(entity); }
private void btnPartFind_Click(object sender, EventArgs e) { client = Common.Util.Service; draw = Common.Util.Drawing; if (draw != null) { ConnectForm f = new ConnectForm(Common.Util.paramsEntity(draw), CommonUntils.RelationType.ALL); f.ShowDialog(); } else { MessageBox.Show("图纸对象为空!"); } }
/// <summary> /// 记录删除 /// </summary> protected void DocDelete() { int rowIndex = dgvDocList.CurrentCell.RowIndex; if (rowIndex < 0) { return; } DataGridViewRow row = dgvDocList.Rows[rowIndex]; IDRAWINGService _docService = ServiceContainer.GetService <DRAWINGService>(); // HYPDM.Entities.PDM_DOCUMENT doc = row.DataBoundItem as HYPDM.Entities.PDM_DOCUMENT; HYPDM.Entities.PDM_DRAWING doc = new PDM_DRAWING(); doc = _docService.GetDrawObjectDCID(row.Cells["DOCID"].Value.ToString()); //doc.LASTUPDATEDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //doc.LASTUPDATEUSER = LoginInfo.LoginCount.ToString(); //doc.DEL_FLAG = "N"; // doc.Update(); IList <PDM_DRAWING> docList = new List <PDM_DRAWING>(); docList.Add(doc); IList <DOC_FILE_LIST> fileList = new List <DOC_FILE_LIST>(); fileList = EAS.Services.ServiceContainer.GetService <DocFileListService>().GetDocFileListByDCID(doc.DOCID); if (doc == null) { return; } if (MessageBox.Show("您确认要删除所选择的文档记录么?\n删除后与其他对象的关联关系也将被解除。\n请确认您的操作。", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { _docService.DocDel(docList, fileList); this.dgvDocList.Rows.Remove(row); } }
/// <summary> /// 图纸对象创建 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDrawCreate_Click(object sender, EventArgs e) { client = Common.Util.Service; //draw =client.GetDrawingByID("29152e50-0b0d-4e15-94a9-847aa7f83725"); //PDM_DRAWING draw = client.GetDrawingByID("e896d90d-55e8-4ef6-af89-4f0333438c04"); //第一种方式,需要已经知道的对象 DrawRegForm form = new DrawRegForm(Common.Util.paramsEntity(draw), lstDrawType.SelectedValue.ToString()); //WcfClient.AddFileFrm f = new WcfClient.AddFileFrm(entity); //第二种方式,不需要传对象 if (DialogResult.OK == form.ShowDialog()) { draw = form.Document; if (draw != null) { lblDrawCode.Text = draw.DOCNO; Common.Util.Drawing = draw; } } }
public PDM_DRAWING GetDrawObjectDCID(string objId) { PDM_DRAWING doc = null; DataEntityQuery <PDM_DRAWING> query = DataEntityQuery <PDM_DRAWING> .Create(); var p = (from item in query where (item.DEL_FLAG == "N") && (item.DOCID == objId) select item); IList <PDM_DRAWING> list = p.ToList(); if (list.Count == 0) { } else { doc = list[0]; } return(doc); }
/// <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 DocDelete() { int rowIndex = dgvDocList.CurrentCell.RowIndex; if (rowIndex < 0) return; DataGridViewRow row = dgvDocList.Rows[rowIndex]; IDRAWINGService _docService = ServiceContainer.GetService<DRAWINGService>(); // HYPDM.Entities.PDM_DOCUMENT doc = row.DataBoundItem as HYPDM.Entities.PDM_DOCUMENT; HYPDM.Entities.PDM_DRAWING doc = new PDM_DRAWING(); doc = _docService.GetDrawObjectDCID(row.Cells["DOCID"].Value.ToString()) ; //doc.LASTUPDATEDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //doc.LASTUPDATEUSER = LoginInfo.LoginCount.ToString(); //doc.DEL_FLAG = "N"; // doc.Update(); IList<PDM_DRAWING> docList = new List<PDM_DRAWING>(); docList.Add(doc); IList<DOC_FILE_LIST> fileList = new List<DOC_FILE_LIST>(); fileList = EAS.Services.ServiceContainer.GetService<DocFileListService>().GetDocFileListByDCID(doc.DOCID); if (doc == null) return; if (MessageBox.Show("您确认要删除所选择的文档记录么?\n删除后与其他对象的关联关系也将被解除。\n请确认您的操作。", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { _docService.DocDel(docList, fileList); this.dgvDocList.Rows.Remove(row); } }
/// <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(); } }