public bool CreateUpdateSecurityControl(SecurityControlEntity securityControlEntity)
        {
            using (var scope = new TransactionScope())
            {
                SecurityControl sc = new SecurityControl()
                {
                    ControlType       = securityControlEntity.ControlType,
                    CreatedBy         = securityControlEntity.CreatedBy,
                    CreatedDate       = securityControlEntity.CreatedDate,
                    Description       = securityControlEntity.Description,
                    Inactive          = securityControlEntity.Inactive,
                    LastModBy         = securityControlEntity.LastModBy,
                    LastModDate       = securityControlEntity.LastModDate,
                    SecurityControlId = securityControlEntity.SecurityControlId
                };

                if (securityControlEntity.SecurityControlId > 0)
                {
                    sc.LastModDate = DateTime.Now;
                    _unitOfWork.SecurityControlRepository.Update(sc);
                    _unitOfWork.Save();
                    scope.Complete();
                }
                else
                {
                    sc.LastModDate = DateTime.Now;
                    sc.CreatedDate = DateTime.Now;
                    _unitOfWork.SecurityControlRepository.Insert(sc);
                    _unitOfWork.Save();
                    scope.Complete();
                }
                return(true);
            }
        }
 private bool SessionTicketNullControl(AuthorizationContext filterContext)
 {
     if (filterContext.RequestContext.HttpContext.Session != null &&
         !SecurityControl.GetSecurityControl(filterContext.RequestContext.HttpContext.Session["userStatus"]))
     {
         return(false);
     }
     return(true);
 }