/// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        internal List<Business.IVirtualDealer> GetAllVirtualDealer()
        {
            List<Business.IVirtualDealer> result = new List<Business.IVirtualDealer>();
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.IVirtualDealerTableAdapter adap = new DSTableAdapters.IVirtualDealerTableAdapter();
            DS.IVirtualDealerDataTable tbIVirtualDealer = new DS.IVirtualDealerDataTable();

            try
            {
                conn.Open();
                adap.Connection = conn;
                result = this.MapIVirtualDealer(adap.GetData());
            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        internal List<Business.VirtualDealer> GetAllVirtualDealer()
        {
            List<Business.VirtualDealer> result = new List<Business.VirtualDealer>();
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.VirtualDealerTableAdapter virtualDealerAdap = new DSTableAdapters.VirtualDealerTableAdapter();
            DSTableAdapters.VirtualDealerConfigTableAdapter configAdap = new DSTableAdapters.VirtualDealerConfigTableAdapter();
            DSTableAdapters.IVirtualDealerTableAdapter iVirtualDealerAdap = new DSTableAdapters.IVirtualDealerTableAdapter();
            DS.VirtualDealerDataTable tbVirtualDealer = new DS.VirtualDealerDataTable();
            DS.VirtualDealerConfigDataTable tbVirtualDealerConfig = new DS.VirtualDealerConfigDataTable();
            DS.IVirtualDealerDataTable tbIVirtualDealer = new DS.IVirtualDealerDataTable();
            try
            {
                conn.Open();
                virtualDealerAdap.Connection = conn;
                configAdap.Connection = conn;
                iVirtualDealerAdap.Connection = conn;

                tbVirtualDealer = virtualDealerAdap.GetData();
                tbVirtualDealerConfig = configAdap.GetData();
                tbIVirtualDealer = iVirtualDealerAdap.GetData();

            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                virtualDealerAdap.Connection.Close();
                configAdap.Connection.Close();
                iVirtualDealerAdap.Connection.Close();
                conn.Close();
            }

            for (int i = 0; i < tbVirtualDealer.Count; i++)
            {
                Business.VirtualDealer dealer = new Business.VirtualDealer();
                dealer.ID = tbVirtualDealer[i].VirtualDealerID;
                dealer.Name = tbVirtualDealer[i].VirtualDealerName;
                for (int j = 0; j < tbVirtualDealerConfig.Count; j++)
                {
                    #region
                    if (tbVirtualDealerConfig[j].VirtualDealID == tbVirtualDealer[i].VirtualDealerID)
                    {
                        double num = 0;
                        switch (tbVirtualDealerConfig[j].Code)
                        {
                            case "VD01":
                                double.TryParse(tbVirtualDealerConfig[j].NumValue, out num);
                                dealer.ProfitMaxPip = num;
                                break;
                            case "VD02":
                                double.TryParse(tbVirtualDealerConfig[j].NumValue, out num);
                                dealer.LossMaxPip = num;
                                break;
                            case "VD03":
                                double.TryParse(tbVirtualDealerConfig[j].NumValue, out num);
                                dealer.StartVolume = num;
                                break;
                            case "VD04":
                                double.TryParse(tbVirtualDealerConfig[j].NumValue, out num);
                                dealer.EndVolume = num;
                                break;
                            case "VD05":
                                int delay;
                                int.TryParse(tbVirtualDealerConfig[j].NumValue, out delay);
                                dealer.Delay = delay;
                                break;
                            case "VD06":
                                double add;
                                double.TryParse(tbVirtualDealerConfig[j].NumValue, out add);
                                dealer.AdditionalPip = add;
                                break;
                            case "VD07":
                                int mode;
                                int.TryParse(tbVirtualDealerConfig[j].NumValue, out mode);
                                dealer.Mode = mode;
                                break;
                            case "VD08":
                                if (tbVirtualDealerConfig[j].BoolValue == 1) dealer.IsEnable = true;
                                else dealer.IsEnable = false;
                                break;
                            case "VD09":
                                if (tbVirtualDealerConfig[j].BoolValue == 1) dealer.IsLimitAuto = true;
                                else dealer.IsLimitAuto = false;
                                break;
                            case "VD10":
                                if (tbVirtualDealerConfig[j].BoolValue == 1) dealer.IsStopAuto = true;
                                else dealer.IsStopAuto = false;
                                break;
                            case "VD11":
                                if (tbVirtualDealerConfig[j].BoolValue == 1) dealer.IsStopSlippage = true;
                                else dealer.IsStopSlippage = false;
                                break;
                            case "VD12":
                                dealer.GroupCondition = tbVirtualDealerConfig[j].StringValue;
                                break;
                            case "VD13":
                                dealer.SymbolCondition = tbVirtualDealerConfig[j].StringValue;
                                break;
                            default:
                                break;
                        }
                    }
                    #endregion
                }

                for (int j = 0; j < tbIVirtualDealer.Count; j++)
                {
                    if (tbVirtualDealer[i].VirtualDealerID == tbIVirtualDealer[j].VirtualDealerID)
                    {
                        Business.IVirtualDealer iVirtualDealer = new Business.IVirtualDealer();
                        iVirtualDealer.InvestorGroupID = tbIVirtualDealer[j].InvestorGroupID;
                        iVirtualDealer.SymbolID = tbIVirtualDealer[j].SymbolID;
                        dealer.IVirtualDealer.Add(iVirtualDealer);
                    }
                }//end for
                result.Add(dealer);
            }//end for
            return result;
        }