/// <summary> /// 获得数据列表 /// </summary> public List <DNSABC.Model.DNSABC_ProductModelDns> DataTableToList(DataTable dt) { List <DNSABC.Model.DNSABC_ProductModelDns> modelList = new List <DNSABC.Model.DNSABC_ProductModelDns>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DNSABC.Model.DNSABC_ProductModelDns model; for (int n = 0; n < rowsCount; n++) { model = new DNSABC.Model.DNSABC_ProductModelDns(); if (dt.Rows[n]["Id"] != null && dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } if (dt.Rows[n]["ProductID"] != null && dt.Rows[n]["ProductID"].ToString() != "") { model.ProductID = int.Parse(dt.Rows[n]["ProductID"].ToString()); } if (dt.Rows[n]["isHost"] != null && dt.Rows[n]["isHost"].ToString() != "") { model.isHost = int.Parse(dt.Rows[n]["isHost"].ToString()); } if (dt.Rows[n]["isTtl"] != null && dt.Rows[n]["isTtl"].ToString() != "") { model.isTtl = int.Parse(dt.Rows[n]["isTtl"].ToString()); } if (dt.Rows[n]["isMonitor"] != null && dt.Rows[n]["isMonitor"].ToString() != "") { model.isMonitor = int.Parse(dt.Rows[n]["isMonitor"].ToString()); } if (dt.Rows[n]["isGroupID"] != null && dt.Rows[n]["isGroupID"].ToString() != "") { model.isGroupID = int.Parse(dt.Rows[n]["isGroupID"].ToString()); } if (dt.Rows[n]["Remark"] != null && dt.Rows[n]["Remark"].ToString() != "") { model.Remark = dt.Rows[n]["Remark"].ToString(); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DNSABC.Model.DNSABC_ProductModelDns model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(DNSABC.Model.DNSABC_ProductModelDns model) { return(dal.Add(model)); }