public string QueryInterfaceProgramList(JQGridModel model)
        {
            try
            {
                int Total = 0;
                model.Sidx = "OrderIndex";

                List <InterfaceProgramModel> List = new DocumentInterfaceDAL().QueryInterfaceProgramList(model, ref Total);

                //构造集合对象
                var JQGridContent = new
                {
                    total   = Total,      //总页数
                    page    = model.Page, //当前页
                    records = model.Rows, //查询出的记录数
                    rows    = List        //包含实际数据的数组
                };

                //将集合对象序列化
                string Result = new JavaScriptSerializer().Serialize(JQGridContent);

                return(Result);
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());
                return("");
            }
        }
        public bool UpdateInterfaceParameter(InterfaceParameterModel model)
        {
            bool Result = false;

            try
            {
                Result = new DocumentInterfaceDAL().UpdateSingleInterfaceParameterModel(model);
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());
            }

            return(Result);
        }
        public bool InsertInterfaceItem(InterfaceItemModel model)
        {
            bool Result = false;

            try
            {
                Result = new DocumentInterfaceDAL().InsertSingleInterfaceItemModel(model);
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());
            }

            return(Result);
        }
        public string QueryInterfaceProgram(int programID)
        {
            string Result = string.Empty;

            try
            {
                InterfaceProgramModel Model = new DocumentInterfaceDAL().SearchDocumentInterfaceProgram(programID);
                Result = new JavaScriptSerializer().Serialize(Model);
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());
            }

            return(Result);
        }
        public string QueryInterfaceParameter(int parameterID)
        {
            string Result = string.Empty;

            try
            {
                InterfaceParameterModel Model = new DocumentInterfaceDAL().SelectInterfaceParameterModel(parameterID);
                Result = new JavaScriptSerializer().Serialize(Model);
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());
            }

            return(Result);
        }
        public bool DeleteInterfaceParameter(int parameterID)
        {
            bool Result = false;

            try
            {
                InterfaceParameterModel model = new InterfaceParameterModel()
                {
                    ParameterID = parameterID
                };
                Result = new DocumentInterfaceDAL().DeleteSingleInterfaceParameterModel(model);
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());
            }

            return(Result);
        }
        public string GetInterfaceItemModel(int programID, int interfaceID, int paremterType)
        {
            InterfaceItemModel Model = new DocumentInterfaceDAL().SearchDocumentInterfaceItem(interfaceID);

            string Result = string.Empty;

            if (Model != default(InterfaceItemModel))
            {
                JavaScriptSerializer Json = new JavaScriptSerializer();
                if (paremterType == 1)
                {
                    Result = Json.Serialize(Model.InputParameter);
                }
                else
                {
                    Result = Json.Serialize(Model.OutputParameter);
                }
            }

            return(Result);
        }
        /// <summary>
        /// 获取接口程序信息
        /// </summary>
        /// <returns></returns>
        public InterfaceProgramModel GetProductInterfaceModel()
        {
            InterfaceProgramModel Model = new DocumentInterfaceDAL().SearchDocumentInterfaceProgram(44);

            StringBuilder Json = new StringBuilder();

            foreach (InterfaceItemModel Item in Model.InterfaceItemList)
            {
                string JsonString = "{\"Title\":\"" + Item.Title + "\",\"InputParameterJSON\":" + Item.InputParameterJSON
                                    + ",\"OutputParameterJSON\":" + Item.OutputParameterJSON + ",\"Method\":\"" + Item.Method + "\"},";

                Json.Append(JsonString);
            }
            string JsonResult = Json.ToString();

            JsonResult = JsonResult.Substring(0, JsonResult.Length - 1);
            JsonResult = string.Format("[{0}]", JsonResult);

            Model.JsonArry = JsonResult;

            return(Model);
        }