/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.HSPR.Tb_HSPR_IncidentRemindersInfo> DataTableToList(DataTable dt) { List <MobileSoft.Model.HSPR.Tb_HSPR_IncidentRemindersInfo> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_IncidentRemindersInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.HSPR.Tb_HSPR_IncidentRemindersInfo model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.HSPR.Tb_HSPR_IncidentRemindersInfo(); //model.InfoID=dt.Rows[n]["InfoID"].ToString(); //model.IncidentID=dt.Rows[n]["IncidentID"].ToString(); if (dt.Rows[n]["CommID"].ToString() != "") { model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString()); } model.RemindersType = dt.Rows[n]["RemindersType"].ToString(); if (dt.Rows[n]["RemindersDate"].ToString() != "") { model.RemindersDate = DateTime.Parse(dt.Rows[n]["RemindersDate"].ToString()); } model.UserID = dt.Rows[n]["UserID"].ToString(); model.UserName = dt.Rows[n]["UserName"].ToString(); model.InfoContent = dt.Rows[n]["InfoContent"].ToString(); model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["IsSendMessage"].ToString() != "") { if ((dt.Rows[n]["IsSendMessage"].ToString() == "1") || (dt.Rows[n]["IsSendMessage"].ToString().ToLower() == "true")) { model.IsSendMessage = true; } else { model.IsSendMessage = false; } } model.SendMessage = dt.Rows[n]["SendMessage"].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_IncidentRemindersInfo model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public long Add(MobileSoft.Model.HSPR.Tb_HSPR_IncidentRemindersInfo model) { return(dal.Add(model)); }