コード例 #1
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            try
            {
                init();
                validate();


                var biz = new UpdateChiTietBiz(context);
                biz.PhieuCongTacChiTietId = _PhieuCongTacChiTietId;
                biz.CtrVersion            = _CtrVersion;

                biz.NoiDung = NoiDung;
                biz.Ngay    = _Ngay;
                biz.SoLuong = _SoLuong;
                biz.DonGia  = _DonGia;
                biz.GhiChu  = GhiChu;

                var result = await biz.Execute();

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, result, null));
            }
            catch (BaseException ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.BadRequest, ex.Message));
            }
            catch (Exception ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.InternalServerError, ex.InnerException != null ? ex.InnerException.Message : ex.Message));
            }
        }
コード例 #2
0
        public async Task <ActionResultDto> Execute(ContextDto context)
        {
            try
            {
                init();
                validate();

                var biz = new UpdateChiTietBiz(context);
                biz.PhieuBaoHanhChiTietId = _PhieuBaoHanhChiTietId;
                biz.ThietBi           = _ThietBi;
                biz.TenThietBi        = TenThietBi;
                biz.MoTa              = MoTa;
                biz.ThietBiThayThe    = _ThietBiThayThe;
                biz.TenThietBiThayThe = TenThietBiThayThe;
                biz.TrangThaiThietBi  = TrangThaiThietBi;
                biz.ChiPhi            = _ChiPhi;
                biz.ThueVAT           = _ThueVAT;
                biz.TienThue          = _TienThue;
                biz.KhuyenMai         = _KhuyenMai;
                biz.LOGIN_ID          = _LoginId;

                var result = await biz.Execute();

                if (string.IsNullOrEmpty(biz.MESSAGE) == false)
                {
                    throw new BaseException(biz.MESSAGE.Split('|')[2]);
                }

                dynamic _metaData = new System.Dynamic.ExpandoObject();

                return(ActionHelper.returnActionResult(HttpStatusCode.OK, result, _metaData));
            }
            catch (BaseException ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.BadRequest, ex.Message));
            }
            catch (Exception ex)
            {
                return(ActionHelper.returnActionError(HttpStatusCode.InternalServerError, ex.InnerException != null ? ex.InnerException.Message : ex.Message));
            }
        }