Esempio n. 1
0
        private Page searchPaginator(string search, int page)
        {
            SQLFunctions sqlFunctions = new SQLFunctions(SQLConnection.DatabaseContext);

            if (quickSearchParam)
            {
                return(sqlFunctions.GetSearchPersonPageData(search, page));
            }

            return(sqlFunctions.GetSearchFullDataPage(search, page));
        }
Esempio n. 2
0
        private Page allDataPaginator(int page)
        {
            SQLFunctions sqlFunctions = new SQLFunctions(SQLConnection.DatabaseContext);

            if (quickSearchParam)
            {
                return(sqlFunctions.GetPageData(page, false, false));
            }

            return(sqlFunctions.GetPageData(page, true, false));
        }
        private async void runTask(SQLFunctionType sqlFunctionType)
        {
            if (ProgressBarIsEnabled)
            {
                return;
            }

            ProgressBarIsEnabled  = true;
            ProgressBarVisibility = Visibility.Visible;

            try
            {
                Task task = null;
                task = Task.Run(() =>
                {
                    SQLFunctions sqlFunctions = new SQLFunctions(SQLConnection.DatabaseContext);

                    switch (sqlFunctionType)
                    {
                    case SQLFunctionType.Add:
                        sqlFunctions.AddData(PersonDataResults);
                        break;

                    case SQLFunctionType.Modify:
                        sqlFunctions.UpdateData(PersonDataResults);
                        break;

                    case SQLFunctionType.Delete:
                        sqlFunctions.DeleteData(PersonDataResults);
                        break;
                    }
                });
                await task;
                if (task != null)
                {
                    task.Dispose();
                }
            }
            catch (Exception Ex)
            {
                LogWriter.Exception("Image task error.", Ex);
            }

            ProgressBarVisibility = Visibility.Hidden;
            ProgressBarIsEnabled  = false;

            CloseDialogWithResult(WindowMessageResult.Accept);
        }