예제 #1
0
파일: chooseframe.cs 프로젝트: Brinews/Code
 public static chooseframe InstanceObject()
 {
     if (_instance == null)
     {
         _instance = new chooseframe();
     }
     return _instance;
 }
예제 #2
0
파일: chooseframe.cs 프로젝트: Brinews/Code
 private void btnComplete_Click(object sender, EventArgs e)
 {
     _instance = null;
     if (null != pbThread)
     {
         this.pbThread.Abort();
         pbThread = null;
     }
     this.Dispose();
 }
예제 #3
0
파일: chooseframe.cs 프로젝트: Brinews/Code
        /************************************窗体控制部分****************************************/
        private void chooseframe_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (null != pbThread)
            {
                pbThread.Abort();
                pbThread = null;
            }

            _instance = null;
        }
예제 #4
0
파일: mainframe.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 编辑映射
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSetCol_Click(object sender, EventArgs e)
        {
            string isChoosed;

            try
            {
                isChoosed = this.dgvMdb.CurrentRow.Cells[0].EditedFormattedValue.ToString();
            }
            catch
            {
                MessageBox.Show("请在第一列中选中需要做映射的表.");
                return;
            }

            if (isChoosed == "True")
            {
                string dstName = this.dgvMdb.CurrentRow.Cells[1].Value.ToString();
                string srcName = this.dgvMdb.CurrentRow.Cells[2].Value.ToString();

                if (!"".Equals(dstName) && !"".Equals(srcName))
                {
                    cf = chooseframe.InstanceObject();
                    cf.SetDaoAndTable(mdbDao, sqlDao, srcName, dstName);

                    //新表,需要根据需要建立
                    if (this.dgvMdb.CurrentCell.RowIndex >= this.mdbTblNum)
                    {
                        cf.SetNewTblFlag(1);
                        cf.BindData();
                    }
                    else
                    {
                        //数据导入现有表
                        cf.DoFormLoad();
                        cf.DataBinding();
                    }

                    cf.Focus();
                    cf.Show();
                }
                else
                {
                    MessageBox.Show("请设置好ACCESS表名和SQL Server表名.");
                    return;
                }
            }
        }