Ejemplo n.º 1
0
        /// <summary>
        /// This fuction is used to Call db to update the call status
        /// </summary>
        /// <param name="sConnString"></param>
        /// <param name="callBackProp"></param>
        /// <param name="callBackAddr"></param>
        /// <returns></returns>
        public DataSet UpdateCallBacksCallDb(string sConnString, CallBackVariable callBackProp, string callBackAddr)
        {
            int isRecording = 0;
            int notify      = 0;
            int grpCallId   = 0;

            DataSet callBackDs = new DataSet();

            DataAccessLayer.V_1_5.GroupcallReports groupCallReportsObj = new DataAccessLayer.V_1_5.GroupcallReports(sConnString);
            callBackDs = groupCallReportsObj.UpdateCallBacksOfGroupCall(callBackProp, callBackAddr, out isRecording, out notify, out grpCallId, out grpCallName, out isInProgress);
            return(callBackDs);
        }
Ejemplo n.º 2
0
        //public JObject GetReportsByBatchIdNew(string sConnString, int userID, int confID, string batchID, int pageIndex, int pageSize)
        //{

        //    int retVal = 0, pageCount = 0;
        //    string retMessage = "";
        //    short isCallFromBonus = 0;
        //    JObject totalCallReportJobj = new JObject();
        //    JObject detailedCallReportJobj = new JObject();
        //    JArray jArr = new JArray();
        //    JArray jArr2 = new JArray();

        //    try
        //    {
        //        DataAccessLayer.V_1_3.GroupcallReports_V130 groupCallReportsObj = new DataAccessLayer.V_1_3.GroupcallReports_V130(sConnString);
        //        ds = groupCallReportsObj.GetReportsByBatchIdNew(userID, confID, batchID, pageIndex, pageSize, out pageCount, out retVal, out retMessage, out isCallFromBonus);
        //        if (retVal == 1)
        //        {
        //            if (ds.Tables.Count > 0)
        //            {
        //                if (ds.Tables[1].Rows.Count > 0)
        //                {
        //                    foreach (DataRow _row in ds.Tables[0].Rows)
        //                    {
        //                        totalCallReportJobj = new JObject();
        //                        foreach (DataColumn _column in ds.Tables[0].Columns)
        //                        {
        //                            totalCallReportJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName]));
        //                        }
        //                        jArr.Add(totalCallReportJobj);
        //                    }
        //                }
        //                if (ds.Tables[1].Rows.Count > 0)
        //                {

        //                    foreach (DataRow _row in ds.Tables[1].Rows)
        //                    {
        //                        detailedCallReportJobj = new JObject();
        //                        foreach (DataColumn _column in ds.Tables[1].Columns)
        //                        {
        //                            detailedCallReportJobj.Add(new JProperty(_column.ColumnName, _row[_column.ColumnName]));
        //                        }
        //                        jArr2.Add(detailedCallReportJobj);
        //                    }

        //                }
        //                jObj = new JObject(new JProperty("Success", true),
        //                                    new JProperty("Message", retMessage),
        //                                    new JProperty("Data", jArr),
        //                                    new JProperty("Data2", jArr2),
        //                                    new JProperty("PageCount", pageCount),
        //                                    new JProperty("IsCallFromBonus", isCallFromBonus));
        //            }

        //            else
        //            {
        //                jObj = new JObject(new JProperty("Success", false),
        //                                  new JProperty("Message", "There are no schedules to this conference"));
        //            }
        //        }

        //    }
        //    catch (Exception ex)
        //    {
        //        Logger.ExceptionLog("Exception in GroupCallReportsBusiness.GetGrpCallReportsLatest is " + ex.ToString());
        //        jObj = new JObject(new JProperty("Success", false),
        //                            new JProperty("Message", "Something Went Wrong"),
        //                            new JProperty("ErrorCode", "E0002"));
        //    }
        //    return jObj;
        //}


        public void Download_ExcelFile(string sConnString, string batchId)
        {
            DataTable dt         = new DataTable();
            int       retVal     = 0;
            string    retMessage = "";
            string    reportName = "";

            try
            {
                HttpResponse Response = HttpContext.Current.Response;
                DataAccessLayer.V_1_5.GroupcallReports grpReports = new DataAccessLayer.V_1_5.GroupcallReports(sConnString);
                dt = grpReports.Download_ExcelFile(batchId, out retVal, out retMessage, out reportName);
                if (retVal == 1)
                {
                    Response.ClearContent();
                    Response.Buffer = true;
                    Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", reportName + ".xls"));
                    Response.ContentType = "application/ms-excel";
                    string str = string.Empty;
                    foreach (DataColumn dtcol in dt.Columns)
                    {
                        Response.Write(str + dtcol.ColumnName);
                        str = "\t";
                    }
                    Response.Write("\n");
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            str = "";
                            for (int j = 0; j < dt.Columns.Count; j++)
                            {
                                Response.Write(str + Convert.ToString(dr[j]));
                                str = "\t";
                            }
                            Response.Write("\n");
                        }
                    }
                    else
                    {
                        Response.Write(retMessage);
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                Logger.ExceptionLog("Exception in GroupCallReportsBusiness.GetGrpCallReports is " + ex.ToString());
            }
        }
Ejemplo n.º 3
0
        public JObject SendEmailReportOfGroup(string sConnString, int userId, JObject paramJobj)
        {
            JObject   responseJObj = new JObject();
            DataTable dt           = new DataTable();

            short  retVal = 0;
            string retMsg = string.Empty;

            try
            {
                if (string.IsNullOrEmpty(Convert.ToString(paramJobj.SelectToken("GroupID"))))
                {
                    responseJObj = new JObject(new JProperty("Success", false),
                                               new JProperty("Message", "Mandatory Parameter missing"), new JProperty("ErrorCode", "111"));
                    return(responseJObj);
                }
                GT.DataAccessLayer.V_1_5.GroupcallReports reportsObj = new DataAccessLayer.V_1_5.GroupcallReports(sConnString);
                dt = reportsObj.SendEmailReportOfGroup(userId, Convert.ToInt64(paramJobj.SelectToken("GroupID")), Convert.ToString(paramJobj.SelectToken("BatchID")), out retVal, out retMsg);
                // string fileName = "Report" + DateTime.Now.ToString("_MMddyyyy_HHmmss") + ".xls";
                // dt.WriteXml(System.Configuration.ConfigurationManager.AppSettings["ReportsPhysicalPath"]+fileName);

                if (retVal == 1)
                {
                    responseJObj = new JObject(new JProperty("Success", true),
                                               new JProperty("Message", retMsg),
                                               new JProperty("ErrorCode", "101"));
                }
                else
                {
                    responseJObj = new JObject(new JProperty("Success", false),
                                               new JProperty("Message", retMsg),
                                               new JProperty("ErrorCode", "101"));
                }
                // reportsObj.SendReportsMail(userId, Convert.ToInt64(paramJobj.SelectToken("GroupID")), fileName, out retVal, out retMsg);
            }
            catch (Exception ex)
            {
                Logger.ExceptionLog("Exception in SendEmailReportOfGroup BAL is " + ex.ToString());
                responseJObj = new JObject(new JProperty("Success", false),
                                           new JProperty("Message", "Something Went Wrong"),
                                           new JProperty("ErrorCode", "101"));
            }
            return(responseJObj);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This function is used to get the grpcall reports from db
        /// </summary>
        /// <param name="sConnString"></param>
        /// <param name="ConfID"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public JObject GetReportsByBatchIdNew(string sConnString, int userID, int confID, string batchID, int pageIndex, int pageSize, string searchText)
        {
            DataSet ds = new DataSet();
            JObject jObj = new JObject();
            JObject jObj1 = new JObject();
            int     retVal = 0, isConfRecorded = 0, pageCount = 0, errorCode = 0;
            int     isRecorded = 0;
            string  retMessage = "";
            short   isCallFromBonus = 0;
            string  confRoom = "", recordedFile = "";
            string  callstatus    = "";
            string  recordPathURL = ConfigurationManager.AppSettings["recordClipPath"].ToString();
            JArray  jArrClips     = new JArray();
            JArray  jArr          = new JArray();
            JArray  jArr1         = new JArray();

            try
            {
                DataAccessLayer.V_1_5.GroupcallReports groupCallReportsObj = new DataAccessLayer.V_1_5.GroupcallReports(sConnString);
                ds = groupCallReportsObj.GetReportsByBatchIdNew(userID, confID, batchID, pageIndex, pageSize, searchText, out pageCount, out retVal, out retMessage, out isCallFromBonus, out errorCode);
                if (retVal == 1)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            var _with1 = ds.Tables[0];
                            if (Convert.ToString(_with1.Rows[0]["RecordClip"].ToString()) != string.Empty)
                            {
                                recordPathURL = recordPathURL + _with1.Rows[0]["RecordClip"].ToString();
                            }
                            else
                            {
                                recordPathURL = "";
                            }
                            jObj1 = (new JObject(new JProperty("Members", _with1.Rows[0]["members"]),
                                                 new JProperty("TotalMembers", _with1.Rows[0]["totmembers"].ToString()),
                                                 new JProperty("CouldNotJoin", _with1.Rows[0]["notjoined"].ToString()),
                                                 new JProperty("ConfName", _with1.Rows[0]["confname"].ToString()),
                                                 new JProperty("RecordClip", recordPathURL),
                                                 new JProperty("TotalCallDuration", _with1.Rows[0]["CallDuration"].ToString()),
                                                 new JProperty("DurationInHours", _with1.Rows[0]["HoursDuration"].ToString()),
                                                 new JProperty("Currency", _with1.Rows[0]["Currency"].ToString()),
                                                 new JProperty("TotalCallPrice", _with1.Rows[0]["TotalCallPrice"].ToString()),
                                                 new JProperty("TotalMinutes", _with1.Rows[0]["TotalMinutes"].ToString()),
                                                 new JProperty("Date", _with1.Rows[0]["Date"].ToString())));
                        }

                        if (ds.Tables[1].Rows.Count > 0)
                        {
                            var _with2 = ds.Tables[1];

                            for (int iterator = 0; iterator < _with2.Rows.Count; iterator++)
                            {
                                if (_with2.Rows[iterator]["status"].ToString() == "")
                                {
                                    callstatus = "No Call";
                                }
                                else
                                {
                                    callstatus = _with2.Rows[iterator]["status"].ToString().Replace("_", " ");
                                }

                                jArr.Add(new JObject(new JProperty("Member", _with2.Rows[iterator]["number"]),
                                                     new JProperty("Status", callstatus),
                                                     new JProperty("MobileNumber", _with2.Rows[iterator]["mobilenumber"].ToString()),
                                                     new JProperty("PricePerMinute", _with2.Rows[iterator]["PricePerMinute"].ToString()),
                                                     new JProperty("mintime", _with2.Rows[iterator]["mintime"].ToString()),
                                                     new JProperty("IsAdded", _with2.Rows[iterator]["IsAdded"].ToString()),
                                                     new JProperty("maxtime", _with2.Rows[iterator]["maxtime"].ToString()),
                                                     new JProperty("Duration", _with2.Rows[iterator]["Duration"].ToString()),
                                                     new JProperty("LeftOn", _with2.Rows[iterator]["LeftOn"].ToString()),
                                                     new JProperty("DurationInHours", _with2.Rows[iterator]["DurationInHours"].ToString())));
                            }
                        }


                        if (ds.Tables[2].Rows.Count > 0)
                        {
                            var _with3 = ds.Tables[2];
                            for (int iterator = 0; iterator < _with3.Rows.Count; iterator++)
                            {
                                jArr1.Add(new JObject(new JProperty("Member", _with3.Rows[iterator]["name"]),
                                                      new JProperty("Number", _with3.Rows[iterator]["MobileNo"].ToString()),
                                                      new JProperty("IsInbound", _with3.Rows[iterator]["isinbound"].ToString()),
                                                      new JProperty("CallPrice", _with3.Rows[iterator]["callprice"].ToString()),
                                                      new JProperty("Duration", _with3.Rows[iterator]["duration"].ToString())));
                            }
                        }

                        jObj = new JObject(new JProperty("Success", true),
                                           new JProperty("Message", retMessage),
                                           new JProperty("ErrorCode", errorCode),
                                           new JProperty("Data", jObj1),
                                           new JProperty("Data2", jArr1),
                                           new JProperty("Items", jArr),
                                           new JProperty("RcFiles", jArrClips),
                                           new JProperty("IsCallFromBonus", isCallFromBonus),
                                           new JProperty("TotalPageCount", pageCount));
                    }
                    else
                    {
                        jObj = new JObject(new JProperty("Success", false),
                                           new JProperty("Message", "There are no schedules to this conference"), new JProperty("ErrorCode", "126"));
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.ExceptionLog("Exception in GroupCallReportsBusiness.GetGrpCallReports is " + ex.ToString());
                jObj = new JObject(new JProperty("Success", false),
                                   new JProperty("Message", "Something Went Wrong"),
                                   new JProperty("ErrorCode", "101"));
            }
            return(jObj);
        }