Exemplo n.º 1
0
        private JObject GetAbandonedcalldetails(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                int AgentId;
                if (Convert.ToInt32(context.Session["RoleId"]) == 1)
                {
                    AgentId = agentId;
                }
                else
                {
                    AgentId = Convert.ToInt32(context.Request["AgentId"]);
                }
                int seesionAgentId = 0;
                seesionAgentId = Convert.ToInt32(context.Session["AgentId"]);
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetAbandonedcalldetails(MyConfig.MyConnectionString, accountId, context.Request["Date"].ToString(), Convert.ToInt32(context.Request["CallDirection"]), Convert.ToInt32(context.Request["CallType"]), Convert.ToInt32(context.Request["CallEndStatus"]), AgentId, Convert.ToInt32(context.Request["SkillGroupId"]), context.Request["FromDate"].ToString(), context.Request["ToDate"].ToString(), Convert.ToInt32(context.Request["PageSize"]), Convert.ToInt32(context.Request["PageNumber"]), Convert.ToInt32(context.Request["StudioId"]), seesionAgentId, roleId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 2
0
        private JObject CallBackRequestManagement(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                //status: status, assignesAgentId: assignedAgentId, skillGroupId: skillGroupId,
                //    dialOutType : dialOuttype,fromDate : fromDate,toDate : toDate
                Press3.BusinessRulesLayer.Calls    callsObject = new Press3.BusinessRulesLayer.Calls();
                UserDefinedClasses.CallbackRequest cbrObj      = new UserDefinedClasses.CallbackRequest();
                cbrObj.Mode      = Convert.ToInt32(context.Request["mode"]);
                cbrObj.AccountId = accountId;
                cbrObj.AgentId   = agentId;
                cbrObj.DialType  = context.Request["dialType"] != null?Convert.ToInt32(context.Request["dialType"]) : 0;

                if (cbrObj.Mode == 1)
                {
                    cbrObj.DateTime = context.Request["dateTime"] != null ? context.Request["dateTime"].ToString() : "";
                    cbrObj.Mobile   = context.Request["mobile"] != null ? context.Request["mobile"].ToString() : "";
                    cbrObj.Notes    = context.Request["notes"] != null ? context.Request["notes"].ToString() : "";
                    cbrObj.CallerId = context.Request["callerId"] != null?Convert.ToInt32(context.Request["callerId"]) : 0;

                    cbrObj.CallId = context.Request["callId"] != null?Convert.ToInt32(context.Request["callId"]) : 0;
                }
                else if (cbrObj.Mode == 2)
                {
                    cbrObj.CbrId = context.Request["CbrId"] != null?Convert.ToInt32(context.Request["CbrId"]) : 0;

                    cbrObj.SearchText      = context.Request["searchText"] != null ? context.Request["searchText"].ToString() : "";
                    cbrObj.AssignedAgentId = context.Request["assignesAgentId"] != null?Convert.ToInt32(context.Request["assignesAgentId"]) : 0;

                    cbrObj.StatusId = context.Request["status"] != null?Convert.ToInt32(context.Request["status"]) : 0;

                    cbrObj.SkillGroupId = context.Request["skillGroupId"] != null?Convert.ToInt32(context.Request["skillGroupId"]) : 0;

                    cbrObj.FromDate = context.Request["fromDate"] != null ? context.Request["fromDate"].ToString() : "";
                    cbrObj.ToDate   = context.Request["toDate"] != null ? context.Request["toDate"].ToString() : "";
                    cbrObj.StudioId = context.Request["StudioId"] != null?Convert.ToInt32(context.Request["StudioId"].ToString()) : 0;
                }
                cbrObj.PageNumber = context.Request["index"] != null?Convert.ToInt32(context.Request["index"].ToString()) : 1;

                cbrObj.PageSize = context.Request["length"] != null?Convert.ToInt32(context.Request["length"].ToString()) : 7;



                responseJObj = callsObject.CallBackRequestManagement(MyConfig.MyConnectionString, cbrObj);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 3
0
        public JObject DownloadRecordedClip(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.DownloadRecordedClip(MyConfig.MyConnectionString, context.Request["clip"]);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 4
0
        private JObject AssignCallBackRequest(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.AssignCallBackRequest(MyConfig.MyConnectionString, accountId, agentId, Convert.ToInt32(context.Request["toAgentId"]), Convert.ToInt32(context.Request["requestId"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 5
0
        private JObject GetCBRSearchRelatedData(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetCBRSearchRelatedData(MyConfig.MyConnectionString, accountId, agentId, roleId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 6
0
        private JObject ChangeCallActions(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.ChangeCallActions(MyConfig.MyConnectionString, Convert.ToInt32(context.Request["Status"]), Convert.ToInt32(context.Request["CallId"]), context.Request["Action"].ToString(), MyConfig.IvrStudioShowClipUploadPath, context.Request["conferenceRoom"].ToString(), Convert.ToBoolean(Convert.ToInt16(context.Request["IsOutbound"].ToString())));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 7
0
        private JObject TransferCall(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.TransferCall(MyConfig.MyConnectionString, agentId, accountId, Convert.ToInt32(context.Request["CallId"]), Convert.ToInt32(context.Request["ToAgentId"]), Convert.ToBoolean(context.Request["IsWarmTransfer"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 8
0
        private JObject GetIvrStudioSelectionDetails(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetIvrStudioSelectionDetails(MyConfig.MyConnectionString, accountId, Convert.ToInt32(context.Request["callId"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 9
0
        private JObject GetCallIdFromCallUUId(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetCallIdFromCallUUId(MyConfig.MyConnectionString, accountId, context.Request["callUUId"]);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 10
0
        private JObject ChangeCallStatus(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.ChangeCallStatus(MyConfig.MyConnectionString, context.Request["Status"].ToString(), agentId, context.Request["CallId"], accountId, context.Request["Action"].ToString(), Convert.ToBoolean(Convert.ToInt16(context.Request["IsOutbound"].ToString())));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 11
0
        private JObject GetCBRreadStatus(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                int CbrId = Convert.ToInt32(context.Request["cbrId"]);
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetCBRreadStatus(MyConfig.MyConnectionString, CbrId, accountId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 12
0
        private JObject GetCallHistorySearchData(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();

                responseJObj = callsObject.GetCallHistorySearchData(MyConfig.MyConnectionString, accountId, agentId, roleId, Convert.ToInt32(context.Request["SkillGroupId"]), context.Request["SearchFor"].ToString());
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 13
0
        private JObject GetUpcomingCBR(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                int    agentid = agentId;
                string CbrIds  = context.Request["cbrIds"];
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetUpcomingCBR(MyConfig.MyConnectionString, agentId, CbrIds, accountId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 14
0
        private JObject UpdateCbrstatus(HttpContext context)
        {
            JObject responseJObj = new JObject();
            int     cbrId        = 0;

            try
            {
                cbrId = context.Request["cbrId"] != null?Convert.ToInt32(context.Request["cbrId"]) : 0;

                int status = Convert.ToInt32(context.Request["status"]);
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.UpdateCbrstatus(MyConfig.MyConnectionString, agentId, status, cbrId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 15
0
        private JObject GetTransferAndConferenceCalls(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                UserDefinedClasses.CallHistoryDetails callHistoryDetailsObj = new UserDefinedClasses.CallHistoryDetails();
                callHistoryDetailsObj.AccountId            = accountId;
                callHistoryDetailsObj.CallId               = Convert.ToInt32(context.Request["CallId"]);
                callHistoryDetailsObj.ConferenceCallTypeId = context.Request["ConferenceCallTypeId"].ToString();
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetTransferAndConferenceCalls(MyConfig.MyConnectionString, callHistoryDetailsObj);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 16
0
        private JObject MakeOutboundCall(HttpContext context)
        {
            JObject responseJObj = new JObject();
            int     customerId = 0; bool isCustomer = false; int cbrId = 0;

            try
            {
                customerId = context.Request["customerId"] != null?Convert.ToInt32(context.Request["customerId"]) : 0;

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

                isCustomer = context.Request["isCustomer"] != null?Convert.ToBoolean(Convert.ToInt16(context.Request["isCustomer"])) : false;

                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.MakeOutboundCall(MyConfig.MyConnectionString, accountId, agentId, customerId, context.Request["callUUID"], context.Request["customerCallUUID"], isCustomer, MyConfig.OutboundCallBackUrl, cbrId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 17
0
        private JObject GetCallHistory(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                UserDefinedClasses.CallHistoryDetails callHistoryDetailsObj = new UserDefinedClasses.CallHistoryDetails();
                callHistoryDetailsObj.AccountId = accountId;
                callHistoryDetailsObj.Date      = context.Request["Date"].ToString();
                if (Convert.ToInt32(context.Session["RoleId"]) == 1)
                {
                    callHistoryDetailsObj.AgentId = agentId;
                }
                else
                {
                    callHistoryDetailsObj.AgentId = Convert.ToInt32(context.Request["AgentId"]);
                }
                callHistoryDetailsObj.SessionAgentId = agentId;
                callHistoryDetailsObj.RoleId         = roleId;
                callHistoryDetailsObj.CallType       = Convert.ToInt32(context.Request["CallType"]);
                callHistoryDetailsObj.CallDirection  = Convert.ToInt32(context.Request["CallDirection"]);
                callHistoryDetailsObj.SkillGroupId   = Convert.ToInt32(context.Request["SkillGroupId"]);
                callHistoryDetailsObj.SkillId        = Convert.ToInt32(context.Request["SkillId"]);
                callHistoryDetailsObj.Duration       = Convert.ToInt32(context.Request["Duration"]);
                callHistoryDetailsObj.PageSize       = Convert.ToInt32(context.Request["PageSize"]);
                callHistoryDetailsObj.PageNumber     = Convert.ToInt32(context.Request["PageNumber"]);
                callHistoryDetailsObj.FromDate       = context.Request["FromDate"].ToString();
                callHistoryDetailsObj.ToDate         = context.Request["ToDate"].ToString();
                callHistoryDetailsObj.CallId         = Convert.ToInt32(context.Request["CallId"]);
                callHistoryDetailsObj.StudioId       = Convert.ToInt32(context.Request["StudioId"]);
                Press3.BusinessRulesLayer.Calls callsObject = new Press3.BusinessRulesLayer.Calls();
                responseJObj = callsObject.GetCallHistory(MyConfig.MyConnectionString, callHistoryDetailsObj);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
Exemplo n.º 18
0
        protected void DownloadToExcel_Click(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();

            UserDefinedClasses.CallbackRequest cbrObj = new UserDefinedClasses.CallbackRequest();
            cbrObj.Mode      = 2;
            cbrObj.AccountId = Session["AccountId"] != null?Convert.ToInt32(Session["AccountId"]) : 0;

            cbrObj.AgentId = Session["AgentId"] != null?Convert.ToInt32(Session["AgentId"]) : 0;

            cbrObj.AssignedAgentId = hdnStickyAgent.Value != null?Convert.ToInt32(hdnStickyAgent.Value) : 0;

            cbrObj.StatusId = hdnstatus.Value != null?Convert.ToInt32(hdnstatus.Value) : 0;

            cbrObj.SkillGroupId = hdnSkillGroup.Value != null?Convert.ToInt32(hdnSkillGroup.Value) : 0;

            cbrObj.DialType = hdnDialOutType.Value != null?Convert.ToInt32(hdnDialOutType.Value) : 0;

            cbrObj.FromDate = hdnFromDate.Value != null?hdnFromDate.Value.ToString() : "";

            cbrObj.ToDate = hdnToDate.Value != null?hdnToDate.Value.ToString() : "";

            cbrObj.SearchText = hdnSearchText.Value != null?hdnSearchText.Value.ToString() : "";

            cbrObj.StudioId = hdnStudioId.Value != null?Convert.ToInt32(hdnStudioId.Value) : 0;

            cbrObj.PageNumber = 1;
            cbrObj.PageSize   = 0;


            Press3.BusinessRulesLayer.Calls callObj = new Press3.BusinessRulesLayer.Calls();
            ds = callObj.DownloadCallBackRequests(MyConfig.MyConnectionString, cbrObj);

            string file_name = "";

            if (ds.Tables[0].Rows.Count > 0)
            {
                try
                {
                    var     wb        = new XSSFWorkbook();
                    var     sheet     = wb.CreateSheet("sheet1");
                    dynamic headerRow = sheet.CreateRow(0);

                    //headerRow.CreateCell(0).SetCellValue("Id");
                    headerRow.CreateCell(0).SetCellValue("Status");
                    headerRow.CreateCell(1).SetCellValue("Closed By");
                    headerRow.CreateCell(2).SetCellValue("Scheduled On");
                    headerRow.CreateCell(3).SetCellValue("Caller Name");
                    headerRow.CreateCell(4).SetCellValue("Mobile Number");
                    headerRow.CreateCell(5).SetCellValue("CBR Notes");
                    headerRow.CreateCell(6).SetCellValue("IVR-Studio");
                    headerRow.CreateCell(7).SetCellValue("Created By");
                    headerRow.CreateCell(8).SetCellValue("Created On");
                    headerRow.CreateCell(9).SetCellValue("Skill Group");
                    headerRow.CreateCell(10).SetCellValue("Sticky Agent");
                    headerRow.CreateCell(11).SetCellValue("Dial Type");

                    //var dstable = ds.tables[0];

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        var _with1 = ds.Tables[0];
                        for (int i = 0; i <= _with1.Rows.Count - 1; i++)  // _with1.Rows.Count - 1
                        {
                            dynamic row = sheet.CreateRow(i + 1);
                            for (int c = 0; c <= ds.Tables[0].Columns.Count - 1; c++)
                            {
                                switch (c)
                                {
                                case 0: row.CreateCell(c).SetCellValue(_with1.Rows[i]["Status"].ToString()); break;

                                case 1: row.CreateCell(c).SetCellValue("-"); break;

                                case 2: row.CreateCell(c).SetCellValue(_with1.Rows[i]["CallDateTime"].ToString()); break;

                                case 3: row.CreateCell(c).SetCellValue(_with1.Rows[i]["CallerName"].ToString()); break;

                                case 4: row.CreateCell(c).SetCellValue(_with1.Rows[i]["Mobile"].ToString()); break;

                                case 5: row.CreateCell(c).SetCellValue(_with1.Rows[i]["Notes"].ToString()); break;

                                case 6: row.CreateCell(c).SetCellValue(_with1.Rows[i]["StudioName"].ToString()); break;

                                case 7: row.CreateCell(c).SetCellValue(_with1.Rows[i]["CreatedBy"].ToString()); break;

                                case 8: row.CreateCell(c).SetCellValue(_with1.Rows[i]["CreatedOn"].ToString()); break;

                                case 9: row.CreateCell(c).SetCellValue(_with1.Rows[i]["Name"].ToString()); break;

                                case 10: row.CreateCell(c).SetCellValue(_with1.Rows[i]["AssignedToAgent"].ToString()); break;

                                case 11: row.CreateCell(c).SetCellValue(_with1.Rows[i]["DialType"].ToString()); break;
                                }
                            }
                        }
                    }

                    //for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                    //{
                    //    dynamic row = sheet.CreateRow(i + 1);
                    //    for (var c = 0; c < ds.Tables[0].Columns.Count - 2; c++)
                    //    {
                    //        row.CreateCell(c).SetCellValue(ds.Tables[0].Rows[i][c + 1].ToString());
                    //    }
                    //}

                    string folderPath = "";
                    folderPath = HttpContext.Current.Server.MapPath("~/CallBackRequests/");
                    // floderName = "ScriptFileUpload";
                    if (!Directory.Exists(folderPath))
                    {
                        Directory.CreateDirectory(folderPath);
                    }

                    string path = System.Web.HttpContext.Current.Server.MapPath("~");
                    file_name = "CallBackRequests_" + DateTime.Now.ToString("ddMMyyyyHHmmssfffff") + ".xlsx";

                    using (var exportData = new FileStream(path + "/CallBackRequests/" + file_name, FileMode.CreateNew))
                    {
                        wb.Write(exportData);
                    }
                    HttpContext.Current.Response.Clear();
                    HttpContext.Current.Response.ClearHeaders();
                    HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
                    HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", file_name));
                    FileInfo Dfile = new FileInfo(path + "/CallBackRequests/" + file_name);
                    HttpContext.Current.Response.WriteFile(Dfile.FullName);
                    HttpContext.Current.Response.Flush();
                    HttpContext.Current.Response.End();
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.ToString());
                }
            }
        }