/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions> DataTableToList(DataTable dt) { List <MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions(); model.SuggestionsID = dt.Rows[n]["SuggestionsID"].ToString(); //model.CommID=dt.Rows[n]["CommID"].ToString(); //model.CustID=dt.Rows[n]["CustID"].ToString(); model.CustName = dt.Rows[n]["CustName"].ToString(); //model.RoomID=dt.Rows[n]["RoomID"].ToString(); model.RoomSign = dt.Rows[n]["RoomSign"].ToString(); model.SuggestionsType = dt.Rows[n]["SuggestionsType"].ToString(); model.SuggestionsTitle = dt.Rows[n]["SuggestionsTitle"].ToString(); model.SuggestionsContent = dt.Rows[n]["SuggestionsContent"].ToString(); if (dt.Rows[n]["IssueDate"].ToString() != "") { model.IssueDate = DateTime.Parse(dt.Rows[n]["IssueDate"].ToString()); } model.LinkPhone = dt.Rows[n]["LinkPhone"].ToString(); model.SuggestionsImages = dt.Rows[n]["SuggestionsImages"].ToString(); model.ReplyStats = dt.Rows[n]["ReplyStats"].ToString(); if (dt.Rows[n]["ReplyDate"].ToString() != "") { model.ReplyDate = DateTime.Parse(dt.Rows[n]["ReplyDate"].ToString()); } model.ReplyContent = dt.Rows[n]["ReplyContent"].ToString(); model.CustEvaluation = dt.Rows[n]["CustEvaluation"].ToString(); if (dt.Rows[n]["EvaluationDate"].ToString() != "") { model.EvaluationDate = DateTime.Parse(dt.Rows[n]["EvaluationDate"].ToString()); } if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.HSPR.Tb_HSPR_CommunitySuggestions model) { dal.Add(model); }