/// <summary> /// 获得数据列表 /// </summary> public List<Light.Model.authenticationinfo> DataTableToList(DataTable dt) { List<Light.Model.authenticationinfo> modelList = new List<Light.Model.authenticationinfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Light.Model.authenticationinfo model; for (int n = 0; n < rowsCount; n++) { model = new Light.Model.authenticationinfo(); if(dt.Rows[n]["id"].ToString()!="") { model.id=int.Parse(dt.Rows[n]["id"].ToString()); } model.authenticationname= dt.Rows[n]["authenticationname"].ToString(); model.Introduction= dt.Rows[n]["Introduction"].ToString(); if(dt.Rows[n]["createman"].ToString()!="") { model.createman=int.Parse(dt.Rows[n]["createman"].ToString()); } if(dt.Rows[n]["createtime"].ToString()!="") { model.createtime=DateTime.Parse(dt.Rows[n]["createtime"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 获得数据列表 /// </summary> public List <Light.Model.authenticationinfo> DataTableToList(DataTable dt) { List <Light.Model.authenticationinfo> modelList = new List <Light.Model.authenticationinfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Light.Model.authenticationinfo model; for (int n = 0; n < rowsCount; n++) { model = new Light.Model.authenticationinfo(); if (dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } model.authenticationname = dt.Rows[n]["authenticationname"].ToString(); model.Introduction = dt.Rows[n]["Introduction"].ToString(); if (dt.Rows[n]["createman"].ToString() != "") { model.createman = int.Parse(dt.Rows[n]["createman"].ToString()); } if (dt.Rows[n]["createtime"].ToString() != "") { model.createtime = DateTime.Parse(dt.Rows[n]["createtime"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Light.Model.authenticationinfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(Light.Model.authenticationinfo model) { dal.Add(model); }