コード例 #1
0
        public JsonResult CreateOpportunity(Opportunity opportunity)
        {
            //var newOpportunityId = OpportunityService.CreateOpporutnity(GetService(), opportunity);
            var newOpportunityId = OpportunityService.CreateOpporutnity(GetHttpClient(), opportunity);

            return(Json(newOpportunityId, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public JsonResult CreateOpportunityAndOpportunityProduct(Opportunity opportunity,
                                                                 OpportunityProduct opportunityProduct)
        {
            var httpClient = GetHttpClient();

            var newOpportunityId = OpportunityService.CreateOpporutnity(httpClient, opportunity);

            opportunityProduct.OpportunityId = newOpportunityId;

            if (newOpportunityId == Guid.Empty)
            {
                return(Json(newOpportunityId, JsonRequestBehavior.AllowGet));
            }

            var newOpportunityProductId =
                OpportunityService.CreateOpportunityProduct(httpClient, opportunityProduct);

            return(Json(newOpportunityId, JsonRequestBehavior.AllowGet));
        }