private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { statisticTypeEnum type = (statisticTypeEnum)this.comboBox1.SelectedValue; this.label_title.Text = string.Format("统计方式:{0,-12}统计时间:{1}至{2}", this.comboBox1.Text, this.dateTimePicker3.Value.ToShortDateString(), this.dateTimePicker4.Value.ToShortDateString()); switch (type) { case statisticTypeEnum.product: statisticProduct(); break; case statisticTypeEnum.customer: statisticCustomer(); break; case statisticTypeEnum.month: statisticMonth(); break; default: break; } }
private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { statisticTypeEnum type = (statisticTypeEnum)this.comboBox1.SelectedValue; switch (type) { case statisticTypeEnum.product: initProductItems(); break; case statisticTypeEnum.customer: initCustomerItems(); break; case statisticTypeEnum.month: initMonthItems(); break; default: break; } this.invokeEndLoadNotify(); this.label_notice.Visible = false; }