private JObject EditLableAndGroups(HttpContext context) { JObject callerDetails = new JObject(); try { Press3.UserDefinedClasses.Callers callersObj = new UserDefinedClasses.Callers(); callersObj.Mode = Convert.ToInt32(context.Request["mode"]); callersObj.AccountId = accountId; callersObj.AgentId = agentId; callersObj.Name = context.Request["Name"].ToString(); callersObj.ColorCode = context.Request["colorCode"].ToString(); callersObj.LabelId = Convert.ToInt32(context.Request["LabelId"]); callersObj.GroupId = Convert.ToInt32(context.Request["groupId"]); Press3.BusinessRulesLayer.Caller callerObject = new Press3.BusinessRulesLayer.Caller(); callerDetails = callerObject.EditLableAndGroups(MyConfig.MyConnectionString, callersObj); } catch (Exception ex) { callerDetails = new JObject(new JProperty("Success", "False"), new JObject("Message", ex.ToString())); Logger.Error(ex.ToString()); } return(callerDetails); }
private JObject CallersManagement(HttpContext context) { JObject callerDetails = new JObject(); try { Press3.UserDefinedClasses.Callers callersObj = new UserDefinedClasses.Callers(); callersObj.Mode = Convert.ToInt32(context.Request["mode"]); callersObj.AccountId = accountId; callersObj.AgentId = agentId; callersObj.SearchText = context.Request["searchText"] != null ? context.Request["searchText"].ToString() : ""; callersObj.GroupId = Convert.ToInt32(context.Request["groupId"]); callersObj.LabelId = Convert.ToInt32(context.Request["labelId"]); callersObj.PageLength = Convert.ToInt32(context.Request["PageLength"]); callersObj.PageIndex = Convert.ToInt32(context.Request["PageIndex"]); Press3.BusinessRulesLayer.Caller callerObject = new Press3.BusinessRulesLayer.Caller(); callerDetails = callerObject.CallersManagement(MyConfig.MyConnectionString, callersObj); } catch (Exception ex) { callerDetails = new JObject(new JProperty("Success", "False"), new JObject("Message", ex.ToString())); Logger.Error(ex.ToString()); } return(callerDetails); }
public DataSet CallersManagement(UserDefinedClasses.Callers callsObj) { _cmd = new SqlCommand(); _ds = new DataSet(); _da = new SqlDataAdapter(); try { _cmd.CommandText = "CallersManagement"; _cmd.CommandType = CommandType.StoredProcedure; _cmd.Connection = Connection; _cmd.Parameters.Add("@Mode", SqlDbType.Int).Value = callsObj.Mode; _cmd.Parameters.Add("@AccountId", SqlDbType.BigInt).Value = callsObj.AccountId; _cmd.Parameters.Add("@AgentId", SqlDbType.BigInt).Value = callsObj.AgentId; _cmd.Parameters.Add("@GroupId", SqlDbType.Int).Value = callsObj.GroupId; _cmd.Parameters.Add("@LabelId", SqlDbType.Int).Value = callsObj.LabelId; _cmd.Parameters.Add("@SearchText", SqlDbType.VarChar, 100).Value = callsObj.SearchText; _cmd.Parameters.Add("@PageLength", SqlDbType.Int).Value = callsObj.PageLength; _cmd.Parameters.Add("@PageIndex", SqlDbType.Int).Value = callsObj.PageIndex; _cmd.Parameters.Add("@Total", SqlDbType.Int).Direction = ParameterDirection.Output; _cmd.Parameters.Add("@SettingsData", SqlDbType.VarChar, -1).Direction = ParameterDirection.Output; _cmd.Parameters.Add("@IsInCall", SqlDbType.Bit).Direction = ParameterDirection.Output; _cmd.Parameters.Add("@Message", SqlDbType.VarChar, 200).Direction = ParameterDirection.Output; _cmd.Parameters.Add("@Success", SqlDbType.Bit).Direction = ParameterDirection.Output; _da.SelectCommand = _cmd; _da.Fill(_ds); if (_ds.Tables.Count > 0) { _ds.Tables[0].TableName = "CallerDetails"; } _ds.Tables.Add(_helper.ConvertOutputParametersToDataTable(_cmd.Parameters)); } catch (Exception ex) { Logger.Error(ex.ToString()); throw ex; } finally { _cmd = null; _da = null; } return(_ds); }
public DataSet EditLableAndGroups(UserDefinedClasses.Callers callsObj) { _cmd = new SqlCommand(); _ds = new DataSet(); _da = new SqlDataAdapter(); try { _cmd.CommandText = "ManageCallerGroupsAndLabels"; _cmd.CommandType = CommandType.StoredProcedure; _cmd.Connection = Connection; _cmd.Parameters.Add("@Mode", SqlDbType.Int).Value = callsObj.Mode; _cmd.Parameters.Add("@Name", SqlDbType.VarChar, 25).Value = callsObj.Name; _cmd.Parameters.Add("@ColorCode", SqlDbType.VarChar, 10).Value = callsObj.ColorCode; _cmd.Parameters.Add("@AccountId", SqlDbType.BigInt).Value = callsObj.AccountId; _cmd.Parameters.Add("@AgentId", SqlDbType.BigInt).Value = callsObj.AgentId; _cmd.Parameters.Add("@GroupId", SqlDbType.Int).Value = callsObj.GroupId; _cmd.Parameters.Add("@LabelId", SqlDbType.Int).Value = callsObj.LabelId; _cmd.Parameters.Add("@Message", SqlDbType.VarChar, 200).Direction = ParameterDirection.Output; _cmd.Parameters.Add("@Success", SqlDbType.Bit).Direction = ParameterDirection.Output; _da.SelectCommand = _cmd; _da.Fill(_ds); if (_ds.Tables.Count > 0) { _ds.Tables[0].TableName = "CallerDetails"; } _ds.Tables.Add(_helper.ConvertOutputParametersToDataTable(_cmd.Parameters)); } catch (Exception ex) { Logger.Error(ex.ToString()); throw ex; } finally { _cmd = null; _da = null; } return(_ds); }
private JObject AddCallersToGroupsOrLabels(HttpContext context) { JObject callerDetails = new JObject(); try { Press3.UserDefinedClasses.Callers callersObj = new UserDefinedClasses.Callers(); callersObj.Mode = Convert.ToInt32(context.Request["mode"]); callersObj.AccountId = accountId; callersObj.AgentId = agentId; callersObj.CallerIds = context.Request["callerIds"].ToString(); callersObj.GroupId = Convert.ToInt32(context.Request["id"]); int sourcegroupId = Convert.ToInt32(context.Request["sourcegroupId"]); Press3.BusinessRulesLayer.Caller callerObject = new Press3.BusinessRulesLayer.Caller(); callerDetails = callerObject.AddCallersToGroupsOrLabels(MyConfig.MyConnectionString, callersObj, sourcegroupId); } catch (Exception ex) { callerDetails = new JObject(new JProperty("Success", "False"), new JObject("Message", ex.ToString())); Logger.Error(ex.ToString()); } return(callerDetails); }
public JObject EditLableAndGroups(String connection, UserDefinedClasses.Callers callsObj) { try { Press3.DataAccessLayer.Caller agentObject = new Press3.DataAccessLayer.Caller(connection); DataSet ds = agentObject.EditLableAndGroups(callsObj); if (ds == null) { helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database"); helper.CreateProperty(UDC.Label.SUCCESS, false); } else { helper.ParseDataSet(ds); } } catch (Exception ex) { helper.CreateProperty(UDC.Label.MESSAGE, ex.ToString()); helper.CreateProperty(UDC.Label.SUCCESS, false); Logger.Error(ex.ToString()); } return(helper.GetResponse()); }