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