Пример #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();
        }
Пример #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);
            }
        }
Пример #3
0
        /// <summary>
        /// 論文匯入
        /// </summary>
        protected void SetPaperTrans(DataSet dsPaper)
        {
            //有三項要轉
            //1.paper
            //2.paperDomainSeq
            //3.PaperSuggestion
            TestLibrary.BLL.BAccessTable bll = new TestLibrary.BLL.BAccessTable();
            BPaper bPaper = new BPaper();

            //刪除所有paper

            lbState.Invoke((Action <string>)SetStatus, "刪除FoodOrg論文資料");
            bPaper.DelAll();
            bPaper.DelPaperSuggestionAll();
            bPaper.DelPaperDomainSeqAll();

            lbState.Invoke((Action <string>)SetStatus, "從access取論文資料移到FoodOrg");

            //1取得所有paper
            //DataSet dsPaper = new BAccessTable().GetPaperList();
            lbl_PaperAll.Invoke((Action <string>)SetPaperAll, dsPaper.Tables[0].Rows.Count.ToString());
            int intPaperCount = 1;

            foreach (DataRow dr in dsPaper.Tables[0].Rows)
            {
                MPaper mPaper = new MPaper();
                mPaper.PaperID = Convert.ToInt32(dr["PaperID"].ToString());



                mPaper.TWYear      = SetTWYear(dr["Period"].ToString());
                mPaper.PaperTitle  = dr["PaperTitle"].ToString();
                mPaper.PaperAuthor = dr["PaperAuthor"].ToString();
                mPaper.Company     = dr["Company"].ToString();
                mPaper.SummaryC    = dr["SummaryC"].ToString().Replace("\r\n", "");
                mPaper.SummaryE    = dr["SummaryE"].ToString().Replace("\r\n", "");

                mPaper.MemberType    = dr["MemberType"].ToString();
                mPaper.MemberID      = SetMemberGed(dr["MARK"].ToString());
                mPaper.Tel1          = dr["Tel1"].ToString();
                mPaper.Tel2          = dr["Tel2"].ToString();
                mPaper.Ext           = dr["Ext"].ToString();
                mPaper.Fax1          = dr["Fax1"].ToString();
                mPaper.Fax2          = dr["Fax2"].ToString();
                mPaper.Email         = dr["Email"].ToString();
                mPaper.UploadDate    = Convert.ToDateTime(dr["UploadDate"].ToString());
                mPaper.PaperDomainID = dr["PaperDomainID"].ToString();
                mPaper.PublishType   = dr["PublishType"].ToString();
                mPaper.Publish       = Convert.ToBoolean(dr["Publish"].ToString());
                mPaper.FileExtension = dr["FileExtension"].ToString();
                mPaper.Examine       = dr["Examine"].ToString();
                if (dr["ExamineDate"].ToString().Length != 0)
                {
                    mPaper.ExamineDate = Convert.ToDateTime(dr["ExamineDate"].ToString());
                }
                mPaper.PaperNo = dr["PaperNo"].ToString();
                bPaper.Add(mPaper);
                int intPaperID = mPaper.PaperID;

                //2.paperDomainSeq
                DataSet dsPaperDomainSeq = bll.GetPaperDomainSeqListByPaperID(Convert.ToInt32(dr["PaperID"].ToString()));
                foreach (DataRow drDomainSeq in dsPaperDomainSeq.Tables[0].Rows)
                {
                    MPaperDomainSeq mDomainSeq = new MPaperDomainSeq();
                    mDomainSeq.PaperID       = intPaperID;
                    mDomainSeq.PaperDomainID = drDomainSeq["PaperDomainID"].ToString();
                    mDomainSeq.Seq           = Convert.ToInt32(drDomainSeq["Seq"].ToString());
                    new BPaperDomainSeq().Add(mDomainSeq);
                }

                //3.PaperSuggestion
                DataSet dsPaperSuggestion = bll.GetPaperSuggestionListByPaperID(Convert.ToInt32(dr["PaperID"].ToString()));
                foreach (DataRow drSuggestion in dsPaperSuggestion.Tables[0].Rows)
                {
                    MPaperSuggestion mSuggestion = new MPaperSuggestion();
                    mSuggestion.PaperID         = intPaperID;
                    mSuggestion.PaperSuggestion = drSuggestion["PaperSuggestion"].ToString();
                    mSuggestion.CreateDate      = Convert.ToDateTime(drSuggestion["CreateDate"].ToString());
                    new BPaperSuggestion().Add(mSuggestion);
                }
                lbPaperCount.Invoke((Action <int>)SetPaper, intPaperCount);
                intPaperCount++;
            }
        }