/// <summary> /// 获得数据列表 /// </summary> public List <university.Model.CCOM.View_Desktop> DataTableToList(DataTable dt) { List <university.Model.CCOM.View_Desktop> modelList = new List <university.Model.CCOM.View_Desktop>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { university.Model.CCOM.View_Desktop model; for (int n = 0; n < rowsCount; n++) { model = new university.Model.CCOM.View_Desktop(); if (dt.Rows[n]["User_id"].ToString() != "") { model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString()); } if (dt.Rows[n]["Sf_id"].ToString() != "") { model.Sf_id = int.Parse(dt.Rows[n]["Sf_id"].ToString()); } model.Sf_url = dt.Rows[n]["Sf_url"].ToString(); if (dt.Rows[n]["Sf_status"].ToString() != "") { if ((dt.Rows[n]["Sf_status"].ToString() == "1") || (dt.Rows[n]["Sf_status"].ToString().ToLower() == "true")) { model.Sf_status = true; } else { model.Sf_status = false; } } if (dt.Rows[n]["Ufd_type"].ToString() != "") { model.Ufd_type = int.Parse(dt.Rows[n]["Ufd_type"].ToString()); } if (dt.Rows[n]["Ufd_sort"].ToString() != "") { model.Ufd_sort = int.Parse(dt.Rows[n]["Ufd_sort"].ToString()); } model.Ufd_name = dt.Rows[n]["Ufd_name"].ToString(); model.Ufd_showname = dt.Rows[n]["Ufd_showname"].ToString(); model.Ufd_icon = dt.Rows[n]["Ufd_icon"].ToString(); model.Ufd_width = dt.Rows[n]["Ufd_width"].ToString(); model.Ufd_color = dt.Rows[n]["Ufd_color"].ToString(); model.Ufd_remark = dt.Rows[n]["Ufd_remark"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(university.Model.CCOM.View_Desktop model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(university.Model.CCOM.View_Desktop model) { dal.Add(model); }