/// <summary> /// Delete access group /// </summary> /// <param name="creator">user login id</param> /// <returns>OK or error from DB</returns> public string Delete(string creator) { string Result = "OK"; DataTable dt = null; try { ServiceReference1.WSACUSoapClient client = new ServiceReference1.WSACUSoapClient(); DataSet ds = client.GroupAccessSave("D", groupId, groupName, groupDescription, creator, DateTime.Today); dt = ds.Tables[0]; Result = dt.Rows[0][0].ToString(); return(Result); } catch (Exception ex) { return(string.Format("Access group class - Delete: {0}", ex.ToString())); } }
/// <summary> /// Update access group info /// </summary> /// <param name="creator">user login id</param> /// <returns>OK or error from DB</returns> public string Update(string creator) { string Result = "OK"; DataTable dt = null; try { ServiceReference1.WSACUSoapClient client = new ServiceReference1.WSACUSoapClient(); DataSet ds = client.GroupAccessSave("U", groupId, groupName, groupDescription, creator, DateTime.Today); dt = ds.Tables[0]; Result = dt.Rows[0][0].ToString(); //Delete old user Result = DeleteAllUser(groupId, creator); //Add user foreach (Users u in listUsers) { Result = AddUser(u.Id, creator); } //Delete old user group Result = DeleteAllUserGroup(groupId, creator); //Add Guser foreach (GroupUser gu in listGroupUsers) { Result = AddUserGroup(gu.groupId, creator); } //Delete old accessLv Result = DeleteAllAccesslv(groupId, creator); //Add accesslv foreach (AccessLevel ac in accessLv) { Result = AddAccessLevel(ac.groupId, creator); } return(Result); } catch (Exception ex) { return(string.Format("Access group class - Update: {0}", ex.ToString())); } }