Ejemplo n.º 1
0
 public IHttpActionResult AddDocketActionItem([FromBody]  DocketActionItem actionItem)
 {
     try
     {
         DataWriter dw     = new DataWriter();
         int        result = dw.AddDocketActionItem(actionItem);
         if (result > 0)
         {
             if (actionItem.DocketActionId == (int)ActionItemType.CampaignReady)
             {
                 dw.AccountSetCampaignReady(actionItem.AccountId);
             }
             if (actionItem.DocketActionId == (int)ActionItemType.ListingReady)
             {
                 dw.AccountSetListingReady(actionItem.ListingId);
             }
             return(Ok(new { id = result }));
         }
         else
         {
             return(StatusCode(HttpStatusCode.BadRequest));
         }
     }
     catch (Exception e)
     {
         if (e.InnerException != null)
         {
             return(InternalServerError(e.InnerException));
         }
         return(InternalServerError(e));
     }
 }