/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.HSPR.Tb_HSPR_IncidentTypeWarning> DataTableToList(DataTable dt) { List <MobileSoft.Model.HSPR.Tb_HSPR_IncidentTypeWarning> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_IncidentTypeWarning>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.HSPR.Tb_HSPR_IncidentTypeWarning model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.HSPR.Tb_HSPR_IncidentTypeWarning(); //model.WarningID=dt.Rows[n]["WarningID"].ToString(); if (dt.Rows[n]["CommID"].ToString() != "") { model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString()); } model.WarningType = dt.Rows[n]["WarningType"].ToString(); if (dt.Rows[n]["WarningHour"].ToString() != "") { model.WarningHour = int.Parse(dt.Rows[n]["WarningHour"].ToString()); } model.WarningMedo = dt.Rows[n]["WarningMedo"].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_IncidentTypeWarning model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.HSPR.Tb_HSPR_IncidentTypeWarning model) { dal.Add(model); }