/// <summary> /// 获取G_Community实体List /// </summary> /// <param name="dt">源数据表</param> /// <returns></returns> public List <G_Community> G_Community(DataTable dt) { List <G_Community> modelList = new List <G_Community>(); G_Community model; for (int n = 0; n < dt.Rows.Count; n++) { model = new G_Community(); try{ model.cm_id = (int)dt.Rows[n]["cm_id"]; } catch { } model.cm_name = dt.Rows[n]["cm_name"].ToString(); try{ model.s_id = (int)dt.Rows[n]["s_id"]; } catch { } model.cm_phone = dt.Rows[n]["cm_phone"].ToString(); try{ model.cm_examine = (bool)dt.Rows[n]["cm_examine"]; } catch { } modelList.Add(model); } return(modelList); }
/// <summary> /// 删除社区 /// </summary> /// <param name="mod">G_Community实体</param> public bool DelCommunity(G_Community mod) { bool b = false; OpSql.Open(); try { b = OpSql.Delete(new object[] { mod }); } catch { } finally { OpSql.Close(); } return(b); }