Example #1
0
        public ActionResult Detail_Read([FromRoute] int _salesOrderDetailId)
        {
            ActionResult response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    Output <SalesOrderDetail_ReadOutput> output = svc.Detail_Read(_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);
        }
Example #2
0
        protected override void LoadData()
        {
            ISalesOrderService svcSalesOrder = DI.Resolve <ISalesOrderService>();
            ErrorList          errorList     = new ErrorList();

            try
            {
                SalesOrderDetail_ReadOutput outDetail_Read;
                using (TimeTracker.ServiceCall)
                    outDetail_Read = svcSalesOrder.Detail_Read((int)obj.SalesOrderDetailIdProperty.TransportValue);
                obj.FromDataContract(outDetail_Read);
            }
            catch (Exception ex)
            {
                errorList.MergeWith(ErrorList.FromException(ex));
            }
            if (svcSalesOrder is IDisposable)
            {
                ((IDisposable)svcSalesOrder).Dispose();
            }
            errors.List.DataSource = errorList.Errors;
            errors.List.DataBind();
            Page.DataBind();
        }