public DAO.GroupDao selectGroupInfoWithId(string id) { string tablename = "t_group"; string sql = "select a.*" + " from " + tablename + " a where id=" + id + " "; DataTable _dt = this.SelectQuery(sql); if (_dt == null || _dt.Rows.Count <= 0) { return(null); } else { DAO.GroupDao _dao = new DAO.GroupDao(); _dao.Grouppname = _dt.Rows[0]["groupname"].ToString(); _dao.Groupmanager = _dt.Rows[0]["groupmanager"].ToString(); _dao.Managerphone = _dt.Rows[0]["managerphone"].ToString(); _dao.Describe = _dt.Rows[0]["desc"].ToString(); return(_dao); } }
public bool updateGroupInfo(string id, DAO.GroupDao dao) { string sql = "update t_group set groupname='" + dao.Grouppname + "',groupmanager='" + dao.Groupmanager + "',managerphone='" + dao.Managerphone + "',`desc`='" + dao.Describe + "' where id=" + id + " "; return(this.updateQuery(sql)); }