Beispiel #1
0
        /// <summary>
        /// Load
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            TestLibrary.BLL.BAccessTable bll = new TestLibrary.BLL.BAccessTable();
            DataSet dsMemberG = bll.GetACCMemberG();
            DataSet dsMemberP = bll.GetACCMemberP();
            DataSet dsFee     = bll.GetFeeList();
            DataSet dsPaper   = bll.GetPaperList();

            DataSet dsOnSite   = bll.GetOnSiteList();
            DataSet dsRegister = bll.GetRegister();
            DataSet dsReceipt  = bll.GetReceipt();
            DataSet dsVote     = bll.GetVote();

            int intMemberGCount = dsMemberG.Tables[0].Rows.Count;
            int intMemberPCount = dsMemberP.Tables[0].Rows.Count;
            int intFeeCount     = dsFee.Tables[0].Rows.Count;
            int intPaperCount   = dsPaper.Tables[0].Rows.Count;

            int intOnsite   = dsOnSite.Tables[0].Rows.Count;
            int intRegister = dsRegister.Tables[0].Rows.Count;
            int intReceipt  = dsReceipt.Tables[0].Rows.Count;
            int intVote     = dsVote.Tables[0].Rows.Count;

            lbl_MemberGAll.Text = intMemberGCount.ToString();
            lbl_MemberPAll.Text = intMemberPCount.ToString();
            lbl_FeeAll.Text     = intFeeCount.ToString();
            lbl_PaperAll.Text   = intPaperCount.ToString();

            lbl_OnSiteAll.Text   = intOnsite.ToString();
            lbl_RegisterAll.Text = intRegister.ToString();
            lbl_ReceiptAll.Text  = intReceipt.ToString();
            lbl_VoteAll.Text     = intVote.ToString();
        }
Beispiel #2
0
        /// <summary>
        /// 在背景所執行的動作
        /// </summary>
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                TestLibrary.BLL.BAccessTable bll = new TestLibrary.BLL.BAccessTable();

                #region  前置取得DataSet

                DataSet dsMemberG = bll.GetACCMemberG();
                DataSet dsMemberP = bll.GetACCMemberP();
                DataSet dsYear    = bll.GetYearList();
                DataSet dsPaper   = bll.GetPaperList();

                //年會相關
                DataSet dsOnSite   = bll.GetOnSiteList();
                DataSet dsRegister = bll.GetRegister();
                DataSet dsReceipt  = bll.GetReceipt();
                DataSet dsVote     = bll.GetVote();

                //費用
                DataSet dsFee = bll.GetFeeList();

                BFeeP bFeeP = new BFeeP();
                bFeeP.DelAll();
                lbState.Invoke((Action <string>)SetStatus, "刪除foodorg所有個人費用資料");


                #endregion

                //團體會員
                SetMemberGTrans(dsMemberG);

                //個人會員
                SetMemberPTrans(dsMemberP);

                ///論文轉換
                SetPaperTrans(dsPaper);

                #region  年會部份

                ///收據
                SetReceiptTrans(dsReceipt);

                ///選票
                SetVoteTrans(dsVote);

                ///年會報名
                SetRegisterTrans(dsRegister);

                ///現場會員
                SetOnSiteRegistrationTrans(dsOnSite);

                #endregion

                ///Fee的費用轉換
                SetFeeTrans(dsFee);


                lbState.Invoke((Action <string>)SetStatus, "完成");
                string            message = "轉換完成";
                string            title   = "完成";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                DialogResult      result  = MessageBox.Show(message, title, buttons);
                if (result == DialogResult.OK)
                {
                    if (!backgroundWorker1.IsBusy)
                    {
                        //LoadData();
                    }
                }
            }
            catch (Exception ex)
            {
                lbState.Invoke((Action <string>)SetStatus, ex.ToString());
                //MessageBox.Show(this,ex.ToString);
            }
        }