/// <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_4.GroupcallReports_V140 groupCallReportsObj = new DataAccessLayer.V_1_4.GroupcallReports_V140(sConnString); callBackDs = groupCallReportsObj.UpdateCallBacksOfGroupCall(callBackProp, callBackAddr, out isRecording, out notify, out grpCallId, out grpCallName, out isInProgress); return(callBackDs); }
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_4.GroupcallReports_V140 grpReports = new DataAccessLayer.V_1_4.GroupcallReports_V140(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()); } }
/// <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_4.GroupcallReports_V140 groupCallReportsObj = new DataAccessLayer.V_1_4.GroupcallReports_V140(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("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); }