public void AddGroup(group g, string email) { UserManager UM = new UserManager(); int id = UM.getUserId(email); using (muleEntities db = new muleEntities()) { group ng = new group(); ng.user_owner_id = id; ng.group_name = g.group_name; ng.description = g.description; ng.private_flag = 0; db.groups.Add(ng); db.SaveChanges(); user_group ug = new user_group(); ug.group_id = getGroupId(g.group_name); ug.user_id = id; ug.is_approved = 1; db.user_group.Add(ug); db.SaveChanges(); } }
public void AddMember(group g, string email) { UserManager UM = new UserManager(); int id = UM.getUserId(email); using (muleEntities db = new muleEntities()) { user_group nug = new user_group(); nug.group_id = g.group_id; nug.user_id = id; nug.is_approved = 0; db.user_group.Add(nug); db.SaveChanges(); } }