示例#1
0
        public JObject CreateOrEditGateway(HttpContext context)
        {
            JObject resultObj = new JObject();

            try
            {
                Press3.BusinessRulesLayer.Manager managerObj = new Press3.BusinessRulesLayer.Manager();
                UDC.Gateway gatewayObj = new UDC.Gateway();
                gatewayObj.AccountId           = accountId;
                gatewayObj.Id                  = (context.Request["gatewayId"] != null && context.Request["gatewayId"] != "") ? Convert.ToInt32(context.Request["gatewayId"]) : 0;
                gatewayObj.Name                = context.Request["gatewayName"];
                gatewayObj.Ip                  = context.Request["serverIp"];
                gatewayObj.RangeCallerIds      = context.Request["rangeCallerIds"];
                gatewayObj.IndividualCallerIds = context.Request["individualCallerIds"];
                gatewayObj.DeletedCallerIds    = context.Request["deletedCallerIds"];
                gatewayObj.TotalChannels       = Convert.ToInt32(context.Request["totalChannels"]);

                resultObj = managerObj.CreateOrEditGateway(MyConfig.MyConnectionString, gatewayObj);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                throw ex;
            }
            return(resultObj);
        }