Beispiel #1
0
        private void RefreshItems(object sender, EventArgs e)
        {
            var biz = new DeliveryBiz();

            dataGridView.DataSource = biz.LoadItems();
            dataGridView.Refresh();
        }
Beispiel #2
0
        private void WorkAsyncCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var biz = new DeliveryBiz();

            dataGridView.DataSource = null;
            dataGridView.DataSource = biz.LoadItems();
            dataGridView.Refresh();
        }
Beispiel #3
0
        public DeliveryView(User user)
        {
            InitializeComponent();
            selectedRow = -1;

            dataGridView.AutoGenerateColumns = false;

            var biz = new DeliveryBiz();
            dataGridView.DataSource = biz.LoadItems();
            dataGridView.Refresh();

            currentUser = user;
            flagSendMail = false;
            flagSendSms = false;

            backgroundWorker.DoWork += new DoWorkEventHandler(WorkAsync);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkAsyncCompleted);
        }
Beispiel #4
0
        public DeliveryView(User user)
        {
            InitializeComponent();
            selectedRow = -1;

            dataGridView.AutoGenerateColumns = false;

            var biz = new DeliveryBiz();

            dataGridView.DataSource = biz.LoadItems();
            dataGridView.Refresh();

            currentUser  = user;
            flagSendMail = false;
            flagSendSms  = false;

            backgroundWorker.DoWork             += new DoWorkEventHandler(WorkAsync);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkAsyncCompleted);
        }
Beispiel #5
0
        public DeliveryView(User user, bool isSendMail = false, bool isSendSms = false, int itemId = 0)
        {
            InitializeComponent();
            selectedRow = -1;

            dataGridView.AutoGenerateColumns = false;

            var biz  = new DeliveryBiz();
            var list = biz.LoadItems();

            dataGridView.DataSource = list;
            dataGridView.Refresh();

            if (list != null && list.Count > 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].Id == itemId)
                    {
                        selectedRow = i;
                        break;
                    }
                }
            }

            currentUser = user;

            backgroundWorker.DoWork             += new DoWorkEventHandler(WorkAsync);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkAsyncCompleted);
            this.flagSendMail = isSendMail;
            this.flagSendSms  = isSendSms;

            if (isSendMail || isSendSms)
            {
                backgroundWorker.RunWorkerAsync(itemId);
            }
        }
Beispiel #6
0
        public DeliveryView(User user, bool isSendMail = false, bool isSendSms = false, int itemId = 0)
        {
            InitializeComponent();
            selectedRow = -1;

            dataGridView.AutoGenerateColumns = false;

            var biz = new DeliveryBiz();
            var list = biz.LoadItems();
            dataGridView.DataSource = list;
            dataGridView.Refresh();

            if(list != null && list.Count > 0)
            {
                for(int i=0;i<list.Count;i++)
                {
                    if (list[i].Id == itemId)
                    {
                        selectedRow = i;
                        break;
                    }
                }
            }

            currentUser = user;

            backgroundWorker.DoWork += new DoWorkEventHandler(WorkAsync);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkAsyncCompleted);
            this.flagSendMail = isSendMail;
            this.flagSendSms = isSendSms;

            if (isSendMail || isSendSms)
            {
                backgroundWorker.RunWorkerAsync(itemId);
            }
        }
Beispiel #7
0
 private void WorkAsyncCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     var biz = new DeliveryBiz();
     dataGridView.DataSource = null;
     dataGridView.DataSource = biz.LoadItems();
     dataGridView.Refresh();
 }
Beispiel #8
0
 private void RefreshItems(object sender, EventArgs e)
 {
     var biz = new DeliveryBiz();
     dataGridView.DataSource = biz.LoadItems();
     dataGridView.Refresh();
 }