public static void Update(long roleId, List <Application> appList)
        {
            List <DAL.tblAuthorizationApplication> tableData =
                DAL.CurrDBContext.Get().tblAuthorizationApplication.Where(x => x.RoleId == roleId).ToList();

            foreach (Application currItem in appList)
            {
                var currTableItem = tableData.
                                    Where(x => x.RoleId == currItem.RoleId && x.ApplicationId == currItem.ApplicationId).SingleOrDefault();

                if (currTableItem == null)
                {
                    currTableItem = new DAL.tblAuthorizationApplication()
                    {
                        RoleId        = currItem.RoleId,
                        ApplicationId = currItem.ApplicationId,
                        AllowLogIn    = currItem.AllowLogIn
                    };

                    DAL.CurrDBContext.Get().tblAuthorizationApplication.Add(currTableItem);
                }
                else
                {
                    currTableItem.RoleId        = currItem.RoleId;
                    currTableItem.ApplicationId = currItem.ApplicationId;
                    currTableItem.AllowLogIn    = currItem.AllowLogIn;
                }
            }

            DAL.CurrDBContext.Get().SaveChanges();
        }
        public static void Update(Application app)
        {
            DAL.tblAuthorizationApplication dataItem = DAL.CurrDBContext.Get().tblAuthorizationApplication.
                                                       Where(x => x.RoleId == app.RoleId && x.ApplicationId == app.ApplicationId).Single();

            dataItem.AllowLogIn = app.AllowLogIn;
            DAL.CurrDBContext.Get().SaveChanges();
        }