Beispiel #1
0
        private void btnBackup_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                w          = new LoadingWindow();
                w.Closing += w_Closing;

                BackgroundWorker bw = new BackgroundWorker();
                bw.WorkerSupportsCancellation = true;
                bw.RunWorkerCompleted        += bw_RunWorkerCompleted;
                bw.DoWork += bwBackup_DoWork;

                System.Windows.Forms.FolderBrowserDialog fd = new System.Windows.Forms.FolderBrowserDialog();
                if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (File.Exists(fd.SelectedPath + "\\" + BaseDataBase.DateNow.ToString("DB_Backup_ddMMyyyy") + ".bak"))
                    {
                        if (MyMessageBox.Show("الموقع الذي تم اختياره يحوي ملف احتياطي بنفس التاريخ\nهل تريد استبداله؟", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                        {
                            File.Delete(fd.SelectedPath + "\\" + BaseDataBase.DateNow.ToString("DB_Backup_ddMMyyyy") + ".bak");
                        }
                        else
                        {
                            bw.CancelAsync(); return;
                        }
                    }
                    bw.RunWorkerAsync(fd.SelectedPath);
                    w.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(ex.Message + "\n\nحدث خطأ أثناء عملية أخذ نسخة احتياطية\nيرجى المحاولة مرة أخرى عبر تغيير موقع الحفظ\n\nفي حال استمرار ظهور المشكلة يرجى مراجعة فريق الدعم");
            }
        }
Beispiel #2
0
 public void LoadingWindow()
 {
     Application.Current.Dispatcher.Invoke((Action) delegate {
         loadingWindow = new LoadingWindow();
         loadingWindow.ShowDialog();
     });
 }
Beispiel #3
0
        public static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                App app = new App();
                app.InitializeComponent();
                app.Run();
            }
            else
            {
                string apkPath = args[0];
                if (string.IsNullOrEmpty(apkPath) == false)
                {
                    if (File.Exists(apkPath) == true)
                    {
                        // MessageBox.Show(apkPath);
                        var window = new LoadingWindow();

                        var apkSigner = new ApkSigner();
                        apkSigner.SetApkPath(apkPath);
                        apkSigner.Execute();
                        apkSigner.FinishCallBack += window.FinishCallBack;
                        App.LoggerCallBack       += window.Log;

                        window.ShowDialog();
                    }
                }
            }
        }
Beispiel #4
0
 public void ShowLoadingUI()
 {
     if (loadingWindow != null)
     {
         return;
     }
     loadingWindow = new LoadingWindow()
     {
         Owner = App.Current.MainWindow
     };
     loadingWindow.ShowDialog();
 }
Beispiel #5
0
 public static void ShowLoadingDialog()
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         if (_loadingWindowIsAlreadyHaveOne)
         {
             return;
         }
         _loadingWindowIsAlreadyHaveOne = true;
         _loadingWindow = new LoadingWindow(_owner);
         _loadingWindow.ShowDialog();
     });
 }
Beispiel #6
0
        public void Run(List <Worksheet> WorkSheet, Dictionary <int, string> columnsFile1, Dictionary <int, string> columnsFile2)
        {
            AsyncTaskCompare task = new AsyncTaskCompare(WorkSheet, columnsFile1, columnsFile2);

            task.OnWorkerComplete += new AsyncTaskCompare.OnWorkerMethodCompleteDelegate(OnWorkerMethodComplete);
            ThreadStart tStart = new ThreadStart(task.WorkerMethod);

            Process = new Thread(tStart);
            Process.Start();

            popup = new LoadingWindow(true);
            popup.ShowDialog();
        }
Beispiel #7
0
        public static void Main()
        {
            LoadingWindow loading = new LoadingWindow();

            bool?result = loading.ShowDialog();

            if (result.Equals(true))
            {
                Application app = new Application();
                app.StartupUri = new Uri("Windows/MainWindow.xaml", UriKind.Relative);
                app.Run();
            }
        }
Beispiel #8
0
        /// <summary>
        ///  Shows the loading window either in normal or dialog mode.
        /// </summary>
        /// <param name="dialog">True if the window should be shown in dialog mode.</param>
        public void ShowLoadingWindow(bool asDialog)
        {
            Window window = new LoadingWindow();

            if (asDialog)
            {
                window.ShowDialog();
            }
            else
            {
                window.Show();
            }
        }
Beispiel #9
0
        private async void buttonUC_Download_PreviewMouseLeftButtonUpAsync(object sender, MouseButtonEventArgs e)
        {
            if (textBox_VideoURL.Text.IndexOf("youtube") == -1)
            {
                MessageBox.Show("Please copy the link as requested. Example\nhttps://www.youtube.com/watch?v=LaQj636PJh0", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            else
            {
                string videoId = FindVideoIdByUrl(textBox_VideoURL.Text);

                await _convertService.SendToIdAsync(videoId);


                loadingWindow.ShowDialog();
            }
        }
Beispiel #10
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // add test data here
            PrepareForTestData();

            Thread t = new Thread(() =>
            {
                LoadingWindow loadingWindow = new LoadingWindow();
                //cache for this process
                Dic["LoadingWindow"] = loadingWindow;
                loadingWindow.ShowDialog();
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            Thread.Sleep(3000);
            base.OnStartup(e);
        }
Beispiel #11
0
        public void Populate()
        {
            _indexes.Clear();
            this.wrapPanel.Children.Clear();
            var loading = new LoadingWindow(_agentService.GetAllAgentsByCompany().ContinueWith(task =>
            {
                if (task.Result.IsSuccess)
                {
                    foreach (AgentResumeViewModel agentViewModel in task.Result.Success.Items)
                    {
                        _indexes.Add(agentViewModel.Id, new AgentUC(OnRemove, OnEdit, agentViewModel, _userBasicInformation));
                    }
                    PopulateByDictionary();
                }
                else
                {
                    MessageBox.Show("Falha na requisição de agents", "Falha", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }, TaskScheduler.FromCurrentSynchronizationContext()));

            loading.ShowDialog();
        }
Beispiel #12
0
        private void btnRestore_Click(object sender, RoutedEventArgs e)
        {
            w          = new LoadingWindow();
            w.Closing += w_Closing;

            BackgroundWorker bw = new BackgroundWorker();

            bw.RunWorkerCompleted        += bw_RunWorkerCompleted;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += bwRestore_DoWork;

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Title           = "إختر ملف الإستعادة";
            ofd.Filter          = "Database Backup Files(*.bak)|*.bak";
            ofd.CheckFileExists = true;

            if (ofd.ShowDialog() == true && ofd.CheckFileExists)
            {
                bw.RunWorkerAsync(ofd.FileName);
                w.ShowDialog();
            }
        }
        public void Refresh(int iType, AnalysisView viewType, int zoneId, DateTime dteStartDate, DateTime DteEndDate)
        {
            try
            {
                _iType = iType;
                //lblStatus.Visibility = Visibility.Hidden;
                //progressBar1.Visibility = Visibility.Hidden;
                lstAnalysisDetails.Visibility   = Visibility.Visible;
                lstCollectionDetails.Visibility = Visibility.Hidden;
                //GridViewColumn_NoOfMC.Width = (viewType == AnalysisView.Zone) ? 78 : 0;
                string reportType = string.Empty;
                switch (iType.ToString())
                {
                case "1":
                    reportType = "DAY";
                    break;

                case "2":
                    reportType = "DROP";
                    break;

                case "3":
                    reportType = "WEEK";
                    break;

                case "4":
                    reportType = "MONTH";
                    break;
                }
                LogManager.WriteLog("UCAnalysisDetails:Refresh ZoneID:" + zoneId + " ReportType:" + reportType, LogManager.enumLogLevel.Info);
                Action doAnalysis = () =>
                {
                    IAnalysis objCashdesk = AnalysisBusinessObject.CreateInstance();
                    dtAnalysisDetails = objCashdesk.GetAnalysisDetails(iType, dteStartDate, DteEndDate, viewType, zoneId);
                };


                if (iType == 2)
                {
                    //Getting Installation No for grabbing current meters
                    IList <int> inst = (new CommonDataAccess()).GetInstallationDetailsForReports(reportType)
                                       .AsEnumerable()
                                       .Where(r => (zoneId == -1 ? true : (r["Zone_No"] != DBNull.Value ? (r.Field <int>("Zone_No") == zoneId) : false)))
                                       .Select(row => row.Field <int>("Installation_No"))
                                       .ToList <int>();

                    //Grabbing current meters from VLT
                    LoadingWindow ld_analysis = new LoadingWindow(this, Audit.Transport.ModuleName.AnalysisDetails, inst, doAnalysis);

                    ld_analysis.ShowDialog();
                }
                else
                {
                    LoadingWindow ld_analysis = new LoadingWindow(this, Audit.Transport.ModuleName.AnalysisDetails, doAnalysis, true);

                    ld_analysis.ShowDialog();
                }

                dtPrintDetails = null;
                dtPrintDetails = dtAnalysisDetails.Copy();
                if (dtPrintDetails.Rows.Count > 0)
                {
                    TotalAvgBet = Convert.ToDecimal(dtPrintDetails.Rows[0]["AvgBet"]);
                    dtPrintDetails.Rows[0].Delete();
                    dtPrintDetails.AcceptChanges();
                }
                lstAnalysisDetails.DataContext = dtAnalysisDetails.DefaultView;
                foreach (Microsoft.Windows.Controls.DataGridColumn gvCol in lstAnalysisDetails.Columns)
                {
                    ResizeGridViewColumn(gvCol);
                    lstAnalysisDetails.Columns[0].Width = 0;
                }
                //txtHeader.Visibility = Visibility.Visible;
                //txtHeader1.Visibility = Visibility.Hidden;
                btnPrint.Visibility  = Visibility.Visible;
                btnExport.Visibility = Visibility.Visible;

                if (!Settings.IsAFTEnabledForSite)
                {
                    this.lstAnalysisDetails.Columns.Remove(gvColCashableEFTIn);
                    this.lstAnalysisDetails.Columns.Remove(gvColCashableEFTOut);
                    this.lstAnalysisDetails.Columns.Remove(gvColNonCashableEFTIn);
                    this.lstAnalysisDetails.Columns.Remove(gvColNonCashableEFTOut);
                    this.lstAnalysisDetails.Columns.Remove(gvColWATIn);
                    this.lstAnalysisDetails.Columns.Remove(gvColWATOut);

                    dtPrintDetails.Columns.Add("CashableEFTIn", typeof(decimal), "0.00");
                    dtPrintDetails.Columns.Add("CashableEFTOut", typeof(decimal), "0.00");
                    dtPrintDetails.Columns.Add("NonCashableEFTIn", typeof(decimal), "0.00");
                    dtPrintDetails.Columns.Add("NonCashableEFTOut", typeof(decimal), "0.00");
                    dtPrintDetails.Columns.Add("WATIn", typeof(decimal), "0.00");
                    dtPrintDetails.Columns.Add("WATOut", typeof(decimal), "0.00");
                }

                GetRefreshedData();
            }
            catch (Exception ex)
            {
                MessageBox.ShowBox(ex.Message, true);
                ExceptionManager.Publish(ex);
            }
        }