Beispiel #1
0
        private void btnResend_Click(object sender, RoutedEventArgs e)
        {
            if (_processForm == null)
            {
                _processForm = new C_DentalClaimTracker.E_Claims.frmProcessor();
            }

            foreach (claim aClaim in GetSelectedClaims())
            {
                try
                {
                    _processForm.ResendClaimApex(aClaim);
                    aClaim.SetResendStatus();
                    ActiveUser.LogAction(ActiveUser.ActionTypes.ResendClaim, aClaim.id, "Apex Resend");

                    if (system_options.ResendStatus > 0)
                    {
                        RefreshStatus(new claim_status(system_options.ResendStatus).name);
                    }
                }
                catch (Exception ex)
                {
                    LoggingHelper.Log(ex, false);
                }
            }
        }
Beispiel #2
0
        private void OpenSelectedClaim()
        {
            if (datResults.SelectedItems.Count == 1)
            {
                int claimID = Convert.ToInt32(((DataRowView)datResults.SelectedItem).Row["ID"]);

                frmClaimManager toShow;
                bool            found         = false;
                claim           selectedClaim = new claim(claimID);

                if (!found)
                {
                    bool readOnly = false;

                    // Double-check to verify the form isn't currently being edited by another user.
                    // If it is, give them the option to open it read-only, or to force full-access
                    List <user> usersViewingclaim = selectedClaim.UsersViewingClaim(true);
                    if (usersViewingclaim.Count > 0)
                    {
                        string userList = string.Empty;
                        foreach (user aUser in usersViewingclaim)
                        {
                            if (userList != string.Empty)
                            {
                                userList += "; ";
                            }
                            userList += aUser.username;
                        }

                        frmClaimInUseDialog frmInUse = new frmClaimInUseDialog(userList);
                        frmInUse.ShowDialog();

                        if (frmInUse.UserChoice == frmClaimInUseDialog.ClaimInUseChoice.DoNotOpen)
                        {
                            return;
                        }
                        else if (frmInUse.UserChoice == frmClaimInUseDialog.ClaimInUseChoice.OpenReadOnly)
                        {
                            readOnly = true;
                        }
                    }

                    List <claim> searchList = new List <claim>();

                    foreach (DataRowView anItem in datResults.Items)
                    {
                        searchList.Add(new claim(Convert.ToInt32(anItem.Row["ID"])));
                    }

                    toShow = new frmClaimManager(readOnly, searchList, selectedClaim);

                    if (readOnly)
                    {
                        ActiveUser.LogAction(ActiveUser.ActionTypes.ViewClaim, selectedClaim.id, "(Read Only) " + selectedClaim.PatientName);
                    }
                    else
                    {
                        ActiveUser.LogAction(ActiveUser.ActionTypes.ViewClaim, selectedClaim.id, selectedClaim.PatientName);
                    }

                    try
                    {
                        toShow.Left = 0;
                        toShow.Top  = 0;
                        toShow.Show();
                    }
                    catch (Exception err)
                    {
                        LoggingHelper.Log(err, false);
                    }
                }
            }
        }
Beispiel #3
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (system_options.ImportFlag)
                {
                    if (MessageBox.Show("The system is currently locked by an administrator. It is recommended that you " +
                                        "wait until this update is complete before logging in to the system.\n\nWould you like to wait until " +
                                        "this update is complete?", "Update in progress", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                    {
                        return;
                    }
                }

                user currentUser = ValidateLogin();
                if (currentUser != null)
                {
                    ActiveUser.UserObject = currentUser;
                    if (chkOpenExclusive.IsChecked.GetValueOrDefault(false))
                    {
                        if (currentUser.is_admin)
                        {
                            if (ActiveUser.UserObject.LoggedInUsers.Count > 0)
                            {
                                string userList = string.Empty;
                                foreach (user aUser in ActiveUser.UserObject.LoggedInUsers)
                                {
                                    if (aUser.id != ActiveUser.UserObject.id)
                                    {
                                        userList += aUser.username + "\n";
                                    }
                                }

                                if (MessageBox.Show("The following users are currently logged in to the system.\n\n" + userList + "\nIf you continue, they might " +
                                                    "have problems with any claims they currently have open. Would you like to continue anyway?", "Continue with import?",
                                                    MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
                                {
                                    return;
                                }
                            }
                            system_options.SetImportFlag(true);
                        }
                        else
                        {
                            MessageBox.Show("You cannot open the program exclusively if you are not an administrator.");
                        }
                    }


                    ActiveUser.UserObject.Login();
                    if (chkOpenExclusive.IsChecked.GetValueOrDefault(false))
                    {
                        ActiveUser.LogAction(ActiveUser.ActionTypes.Login, "Exclusive");
                    }
                    else
                    {
                        ActiveUser.LogAction(ActiveUser.ActionTypes.Login);
                    }

                    C_DentalClaimTracker.Properties.Settings.Default.LastUserName = ActiveUser.UserObject.username;
                    C_DentalClaimTracker.Properties.Settings.Default.Save();

                    if (LoginSuccess != null)
                    {
                        LoginSuccess();
                    }

                    mdiMain.Instance().HideAdminMenu();
                }
                else
                {
                    LoggingHelper.Log("An invalid login was detected. User name: " + txtUserName.Text, LogSeverity.Information);
                    MessageBox.Show("Incorrect login.", "Incorrect login");
                }
            }
            catch (Exception err)
            {
                LoggingHelper.Log(err);
                string errorInfo = err.Message;

                Exception inner = err.InnerException;
                while (inner != null)
                {
                    errorInfo += "\n\n" + inner.Message;
                    inner      = inner.InnerException;
                }

                if (MessageBox.Show("There was an error connecting to the server to validate login information. Would you like to edit " +
                                    "the current server settings?\n\nError:" + errorInfo, "No database connection", MessageBoxButton.YesNo, MessageBoxImage.Error) == MessageBoxResult.Yes)
                {
                    if (RequestEditDBSettings != null)
                    {
                        RequestEditDBSettings();
                    }
                }
            }
        }