Пример #1
0
        public ActionResult ReadList()
        {
            ActionResult response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    Output <ICollection <ShipMethod_ReadListOutput> > output = svc.ReadList();
                    response = StatusCode((int)output.HttpStatus, output);
                    return(response);
                }
                else
                {
                    ModelValidation.AddModelErrors(currentErrors, ModelState);
                }
            }
            catch (Exception ex)
            {
                currentErrors.MergeWith(errorsParser.FromException(ex));
            }
            response = StatusCode((int)currentErrors.HttpStatus, new Output(currentErrors));
            return(response);
        }
Пример #2
0
        public ActionResult Detail_Delete([FromRoute] int _salesOrderDetailId)
        {
            ActionResult response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    Output output = svc.Detail_Delete(_salesOrderDetailId);
                    response = StatusCode((int)output.HttpStatus, output);
                    return(response);
                }
                else
                {
                    ModelValidation.AddModelErrors(currentErrors, ModelState);
                }
            }
            catch (Exception ex)
            {
                currentErrors.MergeWith(errorsParser.FromException(ex));
            }
            response = StatusCode((int)currentErrors.HttpStatus, new Output(currentErrors));
            return(response);
        }
Пример #3
0
        public ActionResult Update([FromRoute] int _salesOrderId, [FromBody] SalesOrder_UpdateInput_Data _data)
        {
            ActionResult response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    Output <SalesOrder_UpdateOutput> output = svc.Update(_salesOrderId, _data);
                    response = StatusCode((int)output.HttpStatus, output);
                    return(response);
                }
                else
                {
                    ModelValidation.AddModelErrors(currentErrors, ModelState);
                }
            }
            catch (Exception ex)
            {
                currentErrors.MergeWith(errorsParser.FromException(ex));
            }
            response = StatusCode((int)currentErrors.HttpStatus, new Output(currentErrors));
            return(response);
        }
Пример #4
0
        public ActionResult ReadList([FromRoute] int _businessEntityId)
        {
            ActionResult response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    Output <ICollection <PersonCreditCard_ReadListOutput> > output = svc.ReadList(_businessEntityId);
                    response = StatusCode((int)output.HttpStatus, output);
                    return(response);
                }
                else
                {
                    ModelValidation.AddModelErrors(currentErrors, ModelState);
                }
            }
            catch (Exception ex)
            {
                currentErrors.MergeWith(errorsParser.FromException(ex));
            }
            response = StatusCode((int)currentErrors.HttpStatus, new Output(currentErrors));
            return(response);
        }