Ejemplo n.º 1
0
 public DataClientClass(string username)
 {
     _username = username;
         Privileges = new DataAdminMessageFactory.ChangePrivilage(false, false, false, false, false, false,false,false);
         AllowedSymbolGroups = new List<int>();
 }
Ejemplo n.º 2
0
        public void OnClientLogon(UserModel tempUser)
        {
            var privileges = new DataAdminMessageFactory.ChangePrivilage(tempUser.AllowDataNet, tempUser.AllowTickNet,
                                                                tempUser.AllowRemoteDb, tempUser.AllowLocalDb,
                                                                tempUser.AllowAnyIp, tempUser.AllowMissBars,
                                                                tempUser.AllowCollectFrCqg, tempUser.AllowDexport)
                                 {ClientID = FindClientByUserName(tempUser.Name).DBId};
            var cl = FindClientByUserName(tempUser.Name);

            var xEle = new XElement("ConnectionString",
                                    new XAttribute("Host", Properties.Settings.Default.connectionHost),
                                    new XAttribute("dbName", Properties.Settings.Default.connectionDB),
                                    new XAttribute("dbNameBar", Properties.Settings.Default.dbBar),
                                    new XAttribute("dbNameHist", Properties.Settings.Default.dbHist),
                                    new XAttribute("dbNameLive", Properties.Settings.Default.dbLive),
                                    new XAttribute("userName", Properties.Settings.Default.connectionUser),
                                    new XAttribute("password", Properties.Settings.Default.connectionPassword));
            var sw = new StringWriter();
            var tx = new XmlTextWriter(sw);
            xEle.WriteTo(tx);

            string str = sw.ToString();

            privileges.ServerMessage = str;

            if (CurrentLoginTypeDnet)
                cl.DClientProxy.onLogon(true, privileges);
            if (CurrentLoginTypeTnet)
                cl.TClientProxy.onLogon(true, privileges);
            if (CurrentLoginTypeDexp)
                cl.DexportProxy.onLogon(true, privileges);

            SendToClientSymbolGroupList(tempUser.Name);
            SendBusySymbolListToClient();
        }