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