public bool Delete(int maNhom, string tennv) { TBL_GROUP_LOGIN PNNVExist = context.TBL_GROUP_LOGINs.Where(t => t.ID_GROUP == maNhom && t.USERNAME.Equals(tennv, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); if (PNNVExist == null) { return(false); } context.TBL_GROUP_LOGINs.Remove(PNNVExist); context.SaveChanges(); return(true); }
// Thêm account mới vào nhóm -final public bool Add(int id, List <string> userNames) { foreach (var username in userNames) { var grouplogin = new TBL_GROUP_LOGIN { ID_GROUP = id, USERNAME = username, ACTIVATE = true }; context.TBL_GROUP_LOGINs.Add(grouplogin); } context.SaveChanges(); return(true); }