コード例 #1
0
        public IActionResult GenerateDataInsertFunction(string ProcedureName, string type)
        {
            var response = new OperationResponse <string>();

            try
            {
                if (codeGeneratorService.SpExists(ProcedureName))
                {
                    if (type == "I")
                    {
                        response.Data = codeGeneratorService.GenerateDataInsertFunction(ProcedureName);
                    }
                    if (type == "U")
                    {
                        response.Data = codeGeneratorService.GenerateDataUpdateFunction(ProcedureName);
                    }
                    if (type == "D")
                    {
                        response.Data = codeGeneratorService.GenerateDataDeleteFunction(ProcedureName);
                    }
                }
                else
                {
                    response.Data  = null;
                    response.State = ResponseState.Error;
                    response.Messages.Add("Sorry the procedure does not exist");
                }
            }
            catch (Exception exception)
            {
                response.State = ResponseState.Error;
                response.Messages.Add(exception.Message);
                _logger.LogError(exception, "Error Getting Procedure Params");
            }

            return(Json(response));
        }