示例#1
0
        private JObject AgentsManagement(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                UserDefinedClasses.Agent agentsobj = new UserDefinedClasses.Agent();
                agentsobj.Mode      = Convert.ToInt32(context.Request["Mode"]);
                agentsobj.AccountId = accountId;
                if (Convert.ToInt32(context.Request["Mode"]) == 1 || Convert.ToInt32(context.Request["Mode"]) == 3)
                {
                    agentsobj.Name                   = context.Request["FullName"].ToString();
                    agentsobj.FirstName              = context.Request["FirstName"].ToString();
                    agentsobj.LastName               = context.Request["LastName"].ToString();
                    agentsobj.Mobile                 = context.Request["Mobile"].ToString();
                    agentsobj.Email                  = context.Request["Email"].ToString();
                    agentsobj.Password               = Convert.ToString(context.Request["Password"]);
                    agentsobj.RoleId                 = Convert.ToInt32(context.Request["Role"]);
                    agentsobj.PhoneType              = Convert.ToInt32(context.Request["PhoneType"]);
                    agentsobj.Skills                 = context.Request["Skill"].ToString();
                    agentsobj.AccountStatusId        = Convert.ToInt32(context.Request["ProfileStatus"]);
                    agentsobj.ReportingManagerIds    = context.Request["ReportingManagers"].ToString();
                    agentsobj.ReportingSupervisorIds = context.Request["ReportingSupervisors"].ToString();
                    agentsobj.Id                 = Convert.ToInt32(context.Request["AgentId"]);
                    agentsobj.SipUserName        = context.Request["SipUserName"].ToString();
                    agentsobj.SipUserPassword    = Convert.ToString(context.Request["SipUserPassword"]);
                    agentsobj.gatewayID          = Convert.ToInt32(context.Request["gatewayID"]);
                    agentsobj.PortNumber         = context.Request["PortNumber"].ToString();
                    agentsobj.LoginType          = Convert.ToInt32(context.Request["LoginType"]);
                    agentsobj.OutBoundAccessType = Convert.ToInt32(context.Request["OutBoundAccessType"]);
                    string str = Convert.ToString(context.Request["ProfileImage"]);
                    if (!String.IsNullOrEmpty(Convert.ToString(context.Request["ProfileImage"])))
                    {
                        Image        _image  = null;
                        MemoryStream mStream = new MemoryStream();
                        byte[]       byteArr;
                        string       tempStoragePath = HttpContext.Current.Server.MapPath("/Images/ProfileImages/");
                        string       tempFileName    = DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".jpg";
                        byteArr = Convert.FromBase64String(context.Request["ProfileImage"].ToString().Replace(" ", "+").Replace("data:image/png;base64,", ""));
                        mStream = new MemoryStream(byteArr);
                        _image  = Image.FromStream(mStream);
                        _image.Save(tempStoragePath + tempFileName);
                        agentsobj.ProfileImagePath = "/Images/ProfileImages/" + tempFileName;
                    }
                }
                else if (Convert.ToInt32(context.Request["Mode"]) == 2)
                {
                    agentsobj.Id = Convert.ToInt32(context.Request["AgentId"]);
                }
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.AgentsMangement(MyConfig.MyConnectionString, agentsobj);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#2
0
        private JObject GetStatusChangeDatewise(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.GetStatusChangeDatewise(MyConfig.MyConnectionString, accountId, agentId, context.Request["date"].ToString());
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#3
0
        private JObject GetAgentInformation(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.GetAgentInformation(MyConfig.MyConnectionString, accountId, agentId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#4
0
        private JObject GetAvailableAgents(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.GetAvailableAgents(MyConfig.MyConnectionString, accountId, Convert.ToInt32(context.Request["CallId"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#5
0
        private JObject GetAgentGatewayDetails(HttpContext context)
        {
            JObject gatewayDetailsJobj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                gatewayDetailsJobj = agentObject.GetAgentGatewayDetails(MyConfig.MyConnectionString, agentId, accountId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(gatewayDetailsJobj);
        }
示例#6
0
        private JObject ChangeSipRegistrationStatus(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.ChangeSipRegistrationStatus(MyConfig.MyConnectionString, Convert.ToInt32(context.Request["Status"]), agentId, accountId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#7
0
        private JObject UpdateProfileImage(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.UpdateProfileImage(MyConfig.MyConnectionString, accountId, Convert.ToInt32(context.Request["AgentId"]), Convert.ToString(context.Request["ProfileImage"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#8
0
        private JObject CheckExtSipUnameExistance(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.CheckExtSipUnameExistance(MyConfig.MyConnectionString, context.Request["SipUname"].ToString(), Convert.ToInt32(context.Request["AgentId"]), Convert.ToInt32(context.Request["Mode"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#9
0
        private JObject GetPress3Health(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                int roleId         = (context.Request["SelectedRole"] != null && context.Request["SelectedRole"] != "") ? Convert.ToInt32(context.Request["SelectedRole"]) : 0;
                int LoginRequired  = (context.Request["LoginRequired"] != null && context.Request["LoginRequired"] != "") ? Convert.ToInt32(context.Request["LoginRequired"]) : 0;
                int deviceStatusId = (context.Request["deviceStatusId"] != null && context.Request["deviceStatusId"] != "") ? Convert.ToInt32(context.Request["deviceStatusId"]) : 2;
                int LoginStatus    = (context.Request["LoginStatus"] != null && context.Request["LoginStatus"] != "") ? Convert.ToInt32(context.Request["LoginStatus"]) : 2;
                int DeviceType     = (context.Request["DeviceType"] != null && context.Request["DeviceType"] != "") ? Convert.ToInt32(context.Request["DeviceType"]) : 0;

                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.GetPress3Health(MyConfig.MyConnectionString, accountId, roleId, LoginRequired, deviceStatusId, LoginStatus, DeviceType);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#10
0
        private JObject LoginTimePolling(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.LoginTimePolling(MyConfig.MyConnectionString, agentId, loginId);
                if (responseJObj["Success"].ToString() == "False")
                {
                    //agentObject.AgentLogout(MyConfig.MyConnectionString, loginId, agentId);
                    //Session.Clear();
                    //Session.Abandon();
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
示例#11
0
        private JObject GetAgents(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                string SearchText  = context.Request["searchText"] != null ? context.Request["searchText"].ToString().Trim() : "";
                int    accStatusId = (context.Request["accStatusId"] != null && context.Request["accStatusId"] != "") ? Convert.ToInt32(context.Request["accStatusId"]) : 0;

                int agentTypeId = (context.Request["agentTypeId"] != null && context.Request["agentTypeId"] != "") ? Convert.ToInt32(context.Request["agentTypeId"]) : 0;

                int deviceStatusId = (context.Request["deviceStatusId"] != null && context.Request["deviceStatusId"] != "") ? Convert.ToInt32(context.Request["deviceStatusId"]) : 0;

                Press3.BusinessRulesLayer.Agent agentObject = new Press3.BusinessRulesLayer.Agent();
                responseJObj = agentObject.GetAgents(MyConfig.MyConnectionString, accountId, SearchText, accStatusId, agentTypeId, deviceStatusId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }