示例#1
0
        public bool Equals(DestinyItemSocketState input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     PlugHash == input.PlugHash ||
                     (PlugHash.Equals(input.PlugHash))
                     ) &&
                 (
                     IsEnabled == input.IsEnabled ||
                     (IsEnabled != null && IsEnabled.Equals(input.IsEnabled))
                 ) &&
                 (
                     IsVisible == input.IsVisible ||
                     (IsVisible != null && IsVisible.Equals(input.IsVisible))
                 ) &&
                 (
                     EnableFailIndexes == input.EnableFailIndexes ||
                     (EnableFailIndexes != null && EnableFailIndexes.SequenceEqual(input.EnableFailIndexes))
                 ));
        }
示例#2
0
        private void ChooseStopsFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            openFileDialog.Filter           = "Pliki txt|*.txt|Pliki Excel|*.xlsx|TXT lub Excel|*.txt;*.xlsx";
            openFileDialog.FilterIndex      = 3;
            openFileDialog.RestoreDirectory = true;
            Nullable <bool> dialogResult = openFileDialog.ShowDialog();

            if (dialogResult == true)
            {
                StopsPath.Text     = openFileDialog.FileName;
                stopsFilePath      = openFileDialog.FileName;
                stopsFileExtension = openFileDialog.SafeFileName.Split('.')[1];
            }
            if (IsStopsFileAdded())
            {
                ChooseTimetableFile.IsEnabled = IsEnabled.Equals(true);
            }
        }
示例#3
0
        public void UpdateUser(UserForm form, JJUserManager userManager, PermissionManager permissionManager)
        {
            var newUser = string.IsNullOrEmpty(FirstName);

            if (newUser)
            {
                AuditLogsToAdd.Add(new UserAuditLog
                {
                    DateEntered         = DateTime.Now,
                    EditedByUser        = form.CurrentUser,
                    EventLogInformation = "Registered user: "******"Updated First Name from:" + FirstName + " to " + form.FirstName + " for User: "******"Updated Last Name from:" + LastName + " to " + form.LastName + " for User: "******"Updated User Name from:" + UserName + " to " + form.UserName + " for User: "******"Updated Email from:" + Email + " to " + form.Email + " for User: "******"Enabled ":"Disabled ") + UserName,
                        UpdatedUser         = this
                    });
                }
            }

            IsEnabled = form.IsEnabled;
            FirstName = form.FirstName;
            LastName  = form.LastName;
            UserName  = form.UserName;
            Email     = form.Email;

            //Delete permissions
            var userPermissionsToDelete =
                Roles.Where(userRole => form.PermissionIds.All(ur => ur != userRole.RoleId)).ToList();

            if (userPermissionsToDelete.Any())
            {
                foreach (
                    var permission in
                    userPermissionsToDelete.Select(
                        userPermission => permissionManager.FindById(userPermission.RoleId)))
                {
                    var result = userManager.RemoveFromRole(Id, permission.Name);
                    if (result.Succeeded)
                    {
                        AuditLogsToAdd.Add(new UserAuditLog
                        {
                            DateEntered         = DateTime.Now,
                            EditedByUser        = form.CurrentUser,
                            EventLogInformation = "Deleted Permission:" + permission.Name + " for User: "******"Added Permission:" + permission.Name + " for User: "******"Failed to add user to role");
                }
            }
        }
示例#4
0
        private void AddDetailButton2_Click(object sender, RoutedEventArgs e)
        {
            if (CardNamebox.Text.Length == 0)
            {
                errormessage.Text = "Please enter your name ";
                CardNamebox.Focus();
            }

            else
            {
                Regex  nonNumericRegex = new Regex(@"\D");
                string CardName        = CardNamebox.Text;
                if (Cardnumberbox.Text.Length != 16)
                {
                    errormessage.Text = "Please Enter 16 digit card number";
                }

                else if (nonNumericRegex.IsMatch(Cardnumberbox.Text))
                {
                    errormessage.Text = "Card Number Must be Numeric";
                }
                else
                {
                    string CardNumber = Cardnumberbox.Text;
                    if ((Monthbox.Text.Length != 2) || (yearbox.Text.Length != 4))
                    {
                        errormessage.Text = "Please enter a valid Expiry Date";
                    }
                    else if (nonNumericRegex.IsMatch(Monthbox.Text) || nonNumericRegex.IsMatch(yearbox.Text))
                    {
                        errormessage.Text = "Expiry Date requires MM/YYYY format";
                    }
                    else
                    {
                        string Mbox = Monthbox.Text;
                        string Ybox = yearbox.Text;
                        if (CardTypebox.SelectedIndex < 0)
                        {
                            errormessage.Text = "Please Select Card Type";
                        }
                        else
                        {
                            if (Cvvbox.Text.Length != 3)
                            {
                                errormessage.Text = "Please Enter 3 digit Cvv Number";
                            }
                            else if (nonNumericRegex.IsMatch(Cvvbox.Text))
                            {
                                errormessage.Text = "CVV Number Must be Numeric";
                            }
                            else
                            {
                                string Cvv = Cvvbox.Text;
                                StackEnableTouser.IsEnabled = IsEnabled.Equals(false);
                                InsertDetails();
                                Reset();
                                errormessage.Text = "Details Added Successfully";
                            }
                        }
                    }
                }
            }
        }