// REMOVE ROLE FROM ACC (DELETE)
 public bool removeAccFromRole(AccRoleMapp accrolemapp)
 {
     /*
      * int idAccounta = Convert.ToInt32(accrolemapp.AccId);
      * using (BazaAccountManEntities ben = new BazaAccountManEntities())
      * {
      *  try
      *  {
      *      List<EmpAccMappTable> eamList = new List<EmpAccMappTable>();
      *      int cid = Convert.ToInt32(empaccmapp.ZapId);
      *      foreach (var obj in listaIspis)
      *      {
      *
      *          EmpAccMappTable eamt = new EmpAccMappTable();
      *
      *          ben.EmpAccMappTables.RemoveRange(ben.EmpAccMappTables.Where(eam => eam.ZaposlenikID == cid));
      *          ben.SaveChanges();
      *
      *      }
      *      ben.SaveChanges();*/
     return(true);
     //}
     //catch
     //{
     //return false;
 }
 // REMOVE ROLE FROM ACC
 public bool removeRoleFromAcc(AccRoleMapp accrolemapp)
 {
     using (BazaAccountManEntities ben = new BazaAccountManEntities())
     {
         try
         {
             int cid = Convert.ToInt32(accrolemapp.AccId);
             AccRoleMappTable armt = ben.AccRoleMappTables.Single(arm => arm.AccID == cid);
             ben.AccRoleMappTables.Remove(armt);
             ben.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
 // ADD ROLE TO ACC
 public bool addRoleToAcc(AccRoleMapp accrolemapp)
 {
     using (BazaAccountManEntities ben = new BazaAccountManEntities())
     {
         try
         {
             AccRoleMappTable armt = new AccRoleMappTable();
             armt.RoleID = accrolemapp.RoleId;
             ben.AccRoleMappTables.Add(armt);
             ben.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
        // ADD ACCOUNT TO ROLE (CREATE)
        public bool addAccToRole(AccRoleMapp accrolemapp)
        {
            int idRole     = Convert.ToInt32(accrolemapp.RoleId);
            int idAccounta = Convert.ToInt32(accrolemapp.AccId);

            using (BazaAccountManEntities ben = new BazaAccountManEntities())
            {
                try
                {
                    AccRoleMappTable armt = new AccRoleMappTable();
                    armt.RoleID = idRole;
                    armt.AccID  = idAccounta;
                    ben.AccRoleMappTables.Add(armt);
                    ben.SaveChanges();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
        }