private void GetDatabaseUserRolesPermissions()
        {
            using (ERPConfigurationContext _data = new ERPConfigurationContext())
            {
                SecUserInfo _user = _data.SecUserInfo.Where(u => u.UserName == this.UserName).FirstOrDefault();
                if (_user != null)
                {
                    this.UserID = _user.UserID;
                    foreach (SecUserInGroup _group in _user.SecUserInGroups)
                    {
                        SecUserGroup _uGroup = _data.SecUserGroup.Where(u => u.GroupID == _group.GroupID).FirstOrDefault();

                        UserRole _userRole = new UserRole {
                            Role_Id = _group.GroupID, RoleName = _uGroup.GroupName
                        };

                        List <SecFormRight> _fRightList = _data.SecFormRight.Where(u => u.GroupID == _group.GroupID).ToList();

                        foreach (SecFormRight _fRight in _fRightList)
                        {
                            SecFormProcess _fproc  = _data.SecFormProcess.Where(u => u.FormProcessID == _fRight.FormProcessID).FirstOrDefault();
                            SecFormList    _frmLst = _data.SecFormList.Where(u => u.FormID == _fproc.FormID).FirstOrDefault();

                            _userRole.Permissions.Add(new RolePermission {
                                FormName = _frmLst.FormName, PermissionName = _fproc.ProcessName
                            });
                        }
                        this.Roles.Add(_userRole);

                        //if (!this.IsSysAdmin)
                        //    this.IsSysAdmin = _group.IsSysAdmin;
                    }
                }
            }

            //}
        }
 public void Setvalues(SecFormList entity, SecFormList existingEntity)
 {
     _service.Setvalues(entity, existingEntity);
 }
 public void Update(SecFormList obj)
 {
     _service.Update(obj);
 }
 public void Delete(SecFormList obj)
 {
     _service.Delete(obj);
 }
 public void Add(SecFormList obj)
 {
     _service.Add(obj);
 }