/// <summary> /// 数据绑定 /// </summary> private void DataBind() { dgvPoint.Rows.Clear(); IList <T_Point> list = bll.GetList(projectNo); foreach (var item in list) { dgvPoint.Rows.Add(); DataGridViewRow dgv = dgvPoint.Rows[dgvPoint.Rows.Count - 1]; dgv.Cells[0].Value = item.ID; dgv.Cells[1].Value = item.OrderIndex; dgv.Cells[2].Value = item.X.ToString(); dgv.Cells[3].Value = item.Y.ToString(); } }
public void setXmlInfo(System.Xml.XmlDocument XmlDoc, System.Xml.XmlElement xmlNode, MDL.T_Projects project, System.Xml.XmlElement element = null) { T_Point_BLL bll = new T_Point_BLL(); IList <T_Point> list = bll.GetList(project.ProjectNO); foreach (var pointItem in list) { XmlElement fileInfo = XmlDoc.CreateElement("pointInfo"); xmlNode.AppendChild(fileInfo); List <T_Model> outList = new List <T_Model>(); outList = ProjectXML_Factory.setXmlInfo(XmlDoc, project, "queryByProjectID", fileInfo, "Point", " where ProjectNo='" + project.ProjectNO + "' and id='" + pointItem.ID + "'"); if (outList != null) { foreach (var item in outList) { XmlElement X_temp = XmlDoc.CreateElement(item.MappColumn); X_temp.SetAttribute("value", item.Default); X_temp.SetAttribute("description", item.Description); fileInfo.AppendChild(X_temp); } } } }