예제 #1
0
        private void BJbackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BJarg arg = e.Argument as BJarg;

            arg.NOR = this.BJselAktifTableAdapter.Fill(this.dataSet.BJ_SEL_AKTIF);
            //DoJobs();

            string HataMsj = string.Empty;

            //Thread.Sleep(5000);
            for (int i = 0; i < this.dataSet.BJ_SEL_AKTIF.Rows.Count; i++)
            {
                if (this.dataSet.BJ_SEL_AKTIF.Rows[i]["USR"].ToString() == "dron")
                {
                    this.dataSet.BJ_SEL_AKTIF.Rows[i]["ENDTS"] = DateTime.Now;
                    // Hata mesajlarini reportProgres ile gonder ki LOG edilebilsin
                    arg.Msj = SendMail(i);
                    BJbackgroundWorker.ReportProgress(i, arg);
                }
            }


            /*
             * Form f = new Form();
             * GridControl grid = new GridControl();
             * grid.Parent = f;
             * grid.Visible = true;
             * GridView view = new GridView(grid);
             * grid.DataSource = this.dataSet.BJ_SEL_AKTIF;
             * grid.Location = new System.Drawing.Point(0, 0);
             * grid.MainView = view as BaseView;
             * grid.Name = "GridControl2";
             * grid.Size = new System.Drawing.Size(518, 273);
             * grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { (BaseView)view });
             * view.GridControl = grid;
             * view.Name = "TempGridView1";
             * //view.RestoreLayoutFromStream(dataStream, DevExpress.Utils.OptionsLayoutBase.FullLayout);
             * //dataStream.Close();
             * grid.ExportToPdf(@"C:\" + DateTime.Now.Minute.ToString() + ".PDF");
             * */

            arg.ExecutionTS = DateTime.Now;

            e.Result = arg;
        }
예제 #2
0
        void timer_Tick(object sender, EventArgs e)
        {
            NOW = DateTime.Now;
            if (BACron.CanRunNow(NOW))
            {
                if (!BAbackgroundWorker.IsBusy)
                {
                    BAbackgroundWorker.RunWorkerAsync(baArg);
                }
            }

            if (BJCron.CanRunNow(NOW))
            {
                if (!BJbackgroundWorker.IsBusy)
                {
                    //BJselAktifGridControl.DataSource = null;
                    BJselAktifGridView.BeginDataUpdate();

                    BJbackgroundWorker.RunWorkerAsync(bjArg);
                }
            }
        }