/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.HSPR.Tb_HSPR_Region> DataTableToList(DataTable dt) { List <MobileSoft.Model.HSPR.Tb_HSPR_Region> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_Region>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.HSPR.Tb_HSPR_Region model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.HSPR.Tb_HSPR_Region(); //model.RegionID=dt.Rows[n]["RegionID"].ToString(); if (dt.Rows[n]["CommID"].ToString() != "") { model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString()); } model.RegionName = dt.Rows[n]["RegionName"].ToString(); if (dt.Rows[n]["RegionSNum"].ToString() != "") { model.RegionSNum = int.Parse(dt.Rows[n]["RegionSNum"].ToString()); } if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } if (dt.Rows[n]["RegionSynchCode"].ToString() != "") { model.RegionSynchCode = new Guid(dt.Rows[n]["RegionSynchCode"].ToString()); } if (dt.Rows[n]["SynchFlag"].ToString() != "") { model.SynchFlag = int.Parse(dt.Rows[n]["SynchFlag"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.HSPR.Tb_HSPR_Region model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.HSPR.Tb_HSPR_Region model) { dal.Add(model); }