Example #1
0
        public Response <AssetDto> Post(AssetDto assetDto)
        {
            Response <AssetDto> response = new Response <AssetDto>();

            try
            {
                AssetContext assetContext = new AssetContext();
                response.Item = assetContext.SaveAsset(assetDto);
                // Configure the Success response.
                response.Code = OperationCode.ResponseCode.SUCCESS;
                response.MessageList.Add(MessageResource.GetInstance().GetText("SawDAL_UpdateSuccess", MESSAGE_RESOURCE));
            }
            catch (Exception ex)
            {
                response.Code = OperationCode.ResponseCode.ERROR;
                response.ErrorList.Add(MessageResource.GetInstance().GetText("SawDAL_UpdateInvalid", MESSAGE_RESOURCE));
            }

            return(response);
        }