/// <summary> /// 获得数据列表 /// </summary> public List <university.Model.CCOM.SMS> DataTableToList(DataTable dt) { List <university.Model.CCOM.SMS> modelList = new List <university.Model.CCOM.SMS>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { university.Model.CCOM.SMS model; for (int n = 0; n < rowsCount; n++) { model = new university.Model.CCOM.SMS(); if (dt.Rows[n]["SMS_id"].ToString() != "") { model.SMS_id = long.Parse(dt.Rows[n]["SMS_id"].ToString()); } if (dt.Rows[n]["Notice_id"].ToString() != "") { model.Notice_id = long.Parse(dt.Rows[n]["Notice_id"].ToString()); } if (dt.Rows[n]["SMS_sender_id"].ToString() != "") { model.SMS_sender_id = long.Parse(dt.Rows[n]["SMS_sender_id"].ToString()); } model.SMS_receiver_id = dt.Rows[n]["SMS_receiver_id"].ToString(); model.SMS_content = dt.Rows[n]["SMS_content"].ToString(); if (dt.Rows[n]["SMS_date"].ToString() != "") { model.SMS_date = DateTime.Parse(dt.Rows[n]["SMS_date"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(university.Model.CCOM.SMS model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public long Add(university.Model.CCOM.SMS model) { return(dal.Add(model)); }