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