Esempio n. 1
0
        public Employee(string strLoginID)
        {
            CommonDataHandler dbHandler = new CommonDataHandler();

            try
            {
                DataSet dsEmpdetails = dbHandler.GetEmployeeDetails(strLoginID);
                if (Utility.HasDataSetRows(dsEmpdetails))
                {
                    this.UserID = strLoginID;
                    this.IsServiceDeliveryGroup = Convert.ToBoolean(dsEmpdetails.Tables[0].Rows[0]["IsServiceDeliveryGroup"] != DBNull.Value ? dsEmpdetails.Tables[0].Rows[0]["IsServiceDeliveryGroup"]: false);
                    this.EmployeeRoles          = new List <Role>();
                    foreach (DataRow row in dsEmpdetails.Tables[0].Rows)
                    {
                        Role objRole = new Role();
                        objRole.RoleId   = Convert.ToInt32(row["RoleId"]);
                        objRole.RoleName = Convert.ToString(row["RoleName"]);
                        if (row["DepartmentID"] != DBNull.Value)
                        {
                            objRole.DeptID = Convert.ToInt32(row["DepartmentID"]);
                        }

                        this.EmployeeRoles.Add(objRole);
                        objRole = null;
                    }
                }
            }
            catch (Exception ex)
            { }
        }
Esempio n. 2
0
        public AsynchronousSocketListener(string ipAddress, int port, string securityToken, int tenantId, int companyId)
        {
            _duoKey = CommonDataHandler.GetEventInfo(securityToken, tenantId, companyId).SocketMsgKey;
            IPAddress ip;

            IPAddress.TryParse(ipAddress, out ip);
            StartListening(ip, port);
        }
Esempio n. 3
0
        public WebSocketServiceHost(string ipAddress, int port, string securityToken, int tenantId, int companyId)
        {
            try
            {
                DuoKey = CommonDataHandler.GetEventInfo(securityToken, tenantId, companyId).SocketMsgKey;
                server = new WebSocketServer(port, IPAddress.Any)
                {
                    OnConnected  = OnConnected,
                    OnDisconnect = OnDisconnected,
                    OnSend       = OnSend,
                    OnConnect    = OnConnect,
                    OnReceive    = OnRecieve,
                    TimeOut      = new TimeSpan(0, 5, 0)
                };

                server.Start();
            }
            catch (Exception exception)
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoLogger2, "WebSocketServiceHost", exception, Logger.LogLevel.Error);
            }
        }