using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace CNAS_DBSync
{
    //public class CnasDataOperation
    //{
    //    //获取数据库的所有表单
    //    public DataTable GetCnasTables(SyncInstrumentItemInfo syncInstrument)
    //    {
    //        BaseDAL baseDAL = new BaseDAL();
    //        baseDAL.CreateConnectString(syncInstrument.SyncTargetDBInfo.DBHost, syncInstrument.SyncTargetDBInfo.DBName, syncInstrument.SyncTargetDBInfo.DBUser, syncInstrument.SyncTargetDBInfo.DBPwd);
    //        return baseDAL.GetTableNames(syncInstrument.SyncTargetDBInfo.DBUser);
    //    }

    //    //获取数据表结构
    //    public DataTable GetCnasTableStruct(SyncInstrumentItemInfo syncInstrument)
    //    {
    //        BaseDAL baseDAL = new BaseDAL();
    //        baseDAL.CreateConnectString(syncInstrument.SyncTargetDBInfo.DBHost, syncInstrument.SyncTargetDBInfo.DBName, syncInstrument.SyncTargetDBInfo.DBUser, syncInstrument.SyncTargetDBInfo.DBPwd);
    //        return baseDAL.GetTableStruct(syncInstrument.LstSyncPramas[0].TargetTable);
    //    }

    //    //插入数据表
    //    public int InsertCnasTableData(DataTable dt, SyncInstrumentItemInfo syncInstrument)
    //    {
    //        BaseDAL baseDAL = new BaseDAL();
    //        baseDAL.CreateConnectString(syncInstrument.SyncTargetDBInfo.DBHost, syncInstrument.SyncTargetDBInfo.DBName, syncInstrument.SyncTargetDBInfo.DBUser, syncInstrument.SyncTargetDBInfo.DBPwd);
    //        return baseDAL.InsertCnasData(dt, syncInstrument.LstSyncPramas);
    //    }

    //    //测试数据连接
    //    public bool TestCnasLink(string strHost,string strName,string strUser,string strPwd)
    //    {
    //        BaseDAL basedal = new BaseDAL();
    //        basedal.CreateConnectString(strHost, strName, strUser, strPwd);
    //        return basedal.LinkCnasTest();
    //    }
    //}
}
