private JObject GetTableByGroups(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.AgentContact getObject = new Press3.BusinessRulesLayer.AgentContact();
                responseJObj = getObject.GetTableByGroups(MyConfig.MyConnectionString, agentId, Convert.ToString(context.Request["GroupName"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
        private JObject GetContactTable(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.AgentContact contactTableObject = new Press3.BusinessRulesLayer.AgentContact();
                responseJObj = contactTableObject.GetContactTable(MyConfig.MyConnectionString, agentId);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
        private JObject DeleteContact(HttpContext context)
        {
            JObject responseJObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.AgentContact deleteObject = new Press3.BusinessRulesLayer.AgentContact();
                responseJObj = deleteObject.DeleteContact(MyConfig.MyConnectionString, agentId, Convert.ToString(context.Request["ContactNumber"]));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(responseJObj);
        }
        private JObject AddContact(HttpContext context)
        {
            JObject callerDetails = new JObject();

            try{
                Press3.BusinessRulesLayer.AgentContact contactObject = new Press3.BusinessRulesLayer.AgentContact();
                callerDetails = contactObject.AddContactDetails(MyConfig.MyConnectionString, Convert.ToString(context.Request["ContactsMobile"]), agentId, context.Request["GroupName"].ToString(), context.Request["ExistingGroup"].ToString(), Convert.ToInt32(context.Request["Mode"]), context.Request["ContactName"].ToString(), context.Request["ContactEmail"].ToString(), context.Request["Notes"].ToString(), context.Request["AlternateMobile"].ToString(), context.Request["OldContact"].ToString());
            }
            catch (Exception ex)
            {
                callerDetails = new JObject(new JProperty("Success", "False"),
                                            new JObject("Message", ex.ToString()));
                Logger.Error(ex.ToString());
            }


            return(callerDetails);
        }