/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.Project_Columns> DataTableToList(DataTable dt) { List <Dianda.Model.Project_Columns> modelList = new List <Dianda.Model.Project_Columns>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.Project_Columns model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.Project_Columns(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.Names = dt.Rows[n]["Names"].ToString(); if (dt.Rows[n]["UpID"].ToString() != "") { model.UpID = int.Parse(dt.Rows[n]["UpID"].ToString()); } model.UserID = dt.Rows[n]["UserID"].ToString(); model.UserInfos = dt.Rows[n]["UserInfos"].ToString(); if (dt.Rows[n]["DELFLAG"].ToString() != "") { model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString()); } if (dt.Rows[n]["DATETIME"].ToString() != "") { model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString()); } model.COLUMNSPATH = dt.Rows[n]["COLUMNSPATH"].ToString(); if (dt.Rows[n]["SHUNXU"].ToString() != "") { model.SHUNXU = int.Parse(dt.Rows[n]["SHUNXU"].ToString()); } model.IMAGEURL = dt.Rows[n]["IMAGEURL"].ToString(); model.PNAMES = dt.Rows[n]["PNAMES"].ToString(); model.TYPES = dt.Rows[n]["TYPES"].ToString(); model.INFORS = dt.Rows[n]["INFORS"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.Project_Columns model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.Project_Columns model) { return(dal.Add(model)); }