/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.HSPR.Tb_HSPR_Community model) { dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.HSPR.Tb_HSPR_Community model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.HSPR.Tb_HSPR_Community> DataTableToList(DataTable dt) { List <MobileSoft.Model.HSPR.Tb_HSPR_Community> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_Community>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.HSPR.Tb_HSPR_Community model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.HSPR.Tb_HSPR_Community(); if (dt.Rows[n]["CommID"].ToString() != "") { model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString()); } if (dt.Rows[n]["BranchID"].ToString() != "") { model.BranchID = int.Parse(dt.Rows[n]["BranchID"].ToString()); } if (dt.Rows[n]["CorpID"].ToString() != "") { model.CorpID = int.Parse(dt.Rows[n]["CorpID"].ToString()); } model.CommName = dt.Rows[n]["CommName"].ToString(); model.CommAddress = dt.Rows[n]["CommAddress"].ToString(); model.Province = dt.Rows[n]["Province"].ToString(); model.City = dt.Rows[n]["City"].ToString(); model.Borough = dt.Rows[n]["Borough"].ToString(); model.Street = dt.Rows[n]["Street"].ToString(); model.GateSign = dt.Rows[n]["GateSign"].ToString(); model.CorpGroupCode = dt.Rows[n]["CorpGroupCode"].ToString(); model.CorpRegionCode = dt.Rows[n]["CorpRegionCode"].ToString(); model.CommSpell = dt.Rows[n]["CommSpell"].ToString(); if (dt.Rows[n]["RegDate"].ToString() != "") { model.RegDate = DateTime.Parse(dt.Rows[n]["RegDate"].ToString()); } if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } model.OrganCode = dt.Rows[n]["OrganCode"].ToString(); if (dt.Rows[n]["UseBeginDate"].ToString() != "") { model.UseBeginDate = DateTime.Parse(dt.Rows[n]["UseBeginDate"].ToString()); } if (dt.Rows[n]["UseEndDate"].ToString() != "") { model.UseEndDate = DateTime.Parse(dt.Rows[n]["UseEndDate"].ToString()); } model.CommKind = dt.Rows[n]["CommKind"].ToString(); if (dt.Rows[n]["ManageTime"].ToString() != "") { model.ManageTime = DateTime.Parse(dt.Rows[n]["ManageTime"].ToString()); } model.ManageKind = dt.Rows[n]["ManageKind"].ToString(); if (dt.Rows[n]["CommSynchCode"].ToString() != "") { model.CommSynchCode = new Guid(dt.Rows[n]["CommSynchCode"].ToString()); } if (dt.Rows[n]["SynchFlag"].ToString() != "") { model.SynchFlag = int.Parse(dt.Rows[n]["SynchFlag"].ToString()); } if (dt.Rows[n]["ContractBeginDate"].ToString() != "") { model.ContractBeginDate = DateTime.Parse(dt.Rows[n]["ContractBeginDate"].ToString()); } if (dt.Rows[n]["ContractEndDate"].ToString() != "") { model.ContractEndDate = DateTime.Parse(dt.Rows[n]["ContractEndDate"].ToString()); } if (dt.Rows[n]["SysStartDate"].ToString() != "") { model.SysStartDate = DateTime.Parse(dt.Rows[n]["SysStartDate"].ToString()); } if (dt.Rows[n]["SysLogDate"].ToString() != "") { model.SysLogDate = DateTime.Parse(dt.Rows[n]["SysLogDate"].ToString()); } if (dt.Rows[n]["IsFees"].ToString() != "") { model.IsFees = int.Parse(dt.Rows[n]["IsFees"].ToString()); } model.Memo = dt.Rows[n]["Memo"].ToString(); if (dt.Rows[n]["CommType"].ToString() != "") { model.CommType = int.Parse(dt.Rows[n]["CommType"].ToString()); } if (dt.Rows[n]["Num"].ToString() != "") { model.Num = int.Parse(dt.Rows[n]["Num"].ToString()); } model.CommunityName = dt.Rows[n]["CommunityName"].ToString(); model.CommunityCode = dt.Rows[n]["CommunityCode"].ToString(); modelList.Add(model); } } return(modelList); }