Пример #1
0
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            this.CreatedDate = DateTime.Now;
            CompanySeller user = Session.FindObject <CompanySeller>(new BinaryOperator("Oid", SecuritySystem.CurrentUserId));

            if (user != null)
            {
                Subsidiary = user.Subsidiary;
                seller     = user;
            }
            // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx).
        }
Пример #2
0
        public override object Authenticate(IObjectSpace objectSpace)
        {
            CompanySeller employee = objectSpace.FindObject <CompanySeller>(
                new BinaryOperator("UserName", customLogon.UserName));

            if (employee == null)
            {
                throw new ArgumentNullException("Employee cant be empty");
            }

            if (!employee.ComparePassword(customLogon.Password))
            {
                throw new AuthenticationException(
                          employee.UserName, "Password mismatch.");
            }

            return(employee);
        }