public override string ClientResponse(bool filterRequired = false)
 {
     if (this.IsPagingOperation || this.IsPagingNextOperation)
     {
         IndentedStringBuilder builder = new IndentedStringBuilder();
         builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeModel.GenericBodyWireTypeString, this.Name);
         builder.AppendLine("{0} body = null;", ReturnTypeModel.ServiceCallGenericParameterString)
         .AppendLine("if (result.getBody() != null) {")
         .Indent().AppendLine("{0}", ReturnTypeModel.ConvertBodyToClientType("result.getBody()", "body"))
         .Outdent().AppendLine("}");
         builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(body, result.getResponse());",
                            ReturnTypeModel.ServiceCallGenericParameterString);
         return(builder.ToString());
     }
     else if (this.IsPagingNonPollingOperation)
     {
         IndentedStringBuilder builder = new IndentedStringBuilder();
         builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeModel.GenericBodyWireTypeString, this.Name);
         builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(result.getBody().getItems(), result.getResponse());",
                            ReturnTypeModel.ServiceCallGenericParameterString);
         return(builder.ToString());
     }
     else
     {
         return(base.ClientResponse(filterRequired));
     }
 }
示例#2
0
        public virtual string SuccessCallback(bool filterRequired = false)
        {
            IndentedStringBuilder builder = new IndentedStringBuilder();

            if (ReturnTypeModel.NeedsConversion)
            {
                builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeModel.GenericBodyWireTypeString, this.Name);
                builder.AppendLine("{0} body = null;", ReturnTypeModel.BodyClientType)
                .AppendLine("if (result.getBody() != null) {")
                .Indent().AppendLine("{0}", ReturnTypeModel.ConvertBodyToClientType("result.getBody()", "body"))
                .Outdent().AppendLine("}");
                builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(body, result.getResponse());",
                                   ReturnTypeModel.GenericBodyClientTypeString);
                builder.AppendLine("if (serviceCallback != null) {")
                .Indent().AppendLine("serviceCallback.success(clientResponse);", ReturnTypeModel.GenericBodyClientTypeString)
                .Outdent().AppendLine("}");
                builder.AppendLine("serviceCall.success(clientResponse);");
            }
            else
            {
                builder.AppendLine("{0} clientResponse = {1}Delegate(response);", ReturnTypeModel.WireResponseTypeString, this.Name);
                builder.AppendLine("if (serviceCallback != null) {")
                .Indent().AppendLine("serviceCallback.success(clientResponse);", this.Name)
                .Outdent().AppendLine("}");
                builder.AppendLine("serviceCall.success(clientResponse);");
            }
            return(builder.ToString());
        }
        // GET: COPR16_RETURNTYPE_MSTR/Create
        public async Task <ActionResult> Create()
        {
            ReturnTypeModel model = new ReturnTypeModel(db);

            model.cOPR16_RETURNTYPE_MSTR = new COPR16_RETURNTYPE_MSTR();
            //model.cOPR16_RTDT_MSTR_LIST = new List<COPR16_RTDT_MSTR>();
            model.cOPR16_RTDT_MSTR_LIST = await db.COPR16_RTDT_MSTR.Where(d => d.RTDT_ID.Equals("")).ToListAsync();;
            return(View(model));
        }
示例#4
0
 public virtual string ResponseGeneration(bool filterRequired = false)
 {
     if (ReturnTypeModel.NeedsConversion)
     {
         IndentedStringBuilder builder = new IndentedStringBuilder();
         builder.AppendLine("ServiceResponse<{0}> response = {1}Delegate(call.execute());",
                            ReturnTypeModel.GenericBodyWireTypeString, this.Name.ToCamelCase());
         builder.AppendLine("{0} body = null;", ReturnTypeModel.BodyClientType.Name)
         .AppendLine("if (response.getBody() != null) {")
         .Indent().AppendLine("{0}", ReturnTypeModel.ConvertBodyToClientType("response.getBody()", "body"))
         .Outdent().AppendLine("}");
         return(builder.ToString());
     }
     return("");
 }
        // GET: COPR16_RETURNTYPE_MSTR/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            ReturnTypeModel model = new ReturnTypeModel(db);

            //model.cOPR16_RTDT_MSTR_LIST = new List<COPR16_RTDT_MSTR>();


            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //COPR16_RETURNTYPE_MSTR cOPR16_RETURNTYPE_MSTR = await db.COPR16_RETURNTYPE_MSTR.FindAsync(id);
            model.cOPR16_RETURNTYPE_MSTR = await db.COPR16_RETURNTYPE_MSTR.FindAsync(id);

            model.cOPR16_RTDT_MSTR_LIST = await db.COPR16_RTDT_MSTR.Where(d => d.RTTYPE_ID.Equals(id) && d.FLGACT.Value == true).ToListAsync();;
            if (model.cOPR16_RETURNTYPE_MSTR == null)
            {
                return(HttpNotFound());
            }
            //return View(cOPR16_RETURNTYPE_MSTR);
            return(View(model));
        }