Ejemplo n.º 1
0
 public static void UpdateXN_TraKetQuaChiTiet(this XN_TraKQ_ChiTiet xnTraKetQuaChiTiet, XN_TraKQ_ChiTietViewModel xnTraKetQuaChiTietVm)
 {
     xnTraKetQuaChiTietVm.RowIDXN_TraKetQua_ChiTiet = xnTraKetQuaChiTietVm.RowIDXN_TraKetQua_ChiTiet;
     xnTraKetQuaChiTietVm.MaDichVu        = xnTraKetQuaChiTietVm.MaDichVu;
     xnTraKetQuaChiTietVm.IDThongSoXN     = xnTraKetQuaChiTietVm.IDThongSoXN;
     xnTraKetQuaChiTietVm.TenThongSo      = xnTraKetQuaChiTietVm.TenThongSo;
     xnTraKetQuaChiTietVm.TenKyThuat      = xnTraKetQuaChiTietVm.TenKyThuat;
     xnTraKetQuaChiTietVm.IDKyThuat       = xnTraKetQuaChiTietVm.IDKyThuat;
     xnTraKetQuaChiTietVm.GiaTri1         = xnTraKetQuaChiTietVm.GiaTri1;
     xnTraKetQuaChiTietVm.GiaTriMin       = xnTraKetQuaChiTietVm.GiaTriMin;
     xnTraKetQuaChiTietVm.GiaTriMax       = xnTraKetQuaChiTietVm.GiaTriMax;
     xnTraKetQuaChiTietVm.DonViTinh       = xnTraKetQuaChiTietVm.DonViTinh;
     xnTraKetQuaChiTietVm.isNguyCo        = xnTraKetQuaChiTietVm.isNguyCo;
     xnTraKetQuaChiTietVm.GiaTriTrungBinh = xnTraKetQuaChiTietVm.GiaTriTrungBinh;
     xnTraKetQuaChiTietVm.GiaTri2         = xnTraKetQuaChiTietVm.GiaTri2;
     xnTraKetQuaChiTietVm.GiaTriCuoi      = xnTraKetQuaChiTietVm.GiaTriCuoi;
     xnTraKetQuaChiTietVm.IDDonViTinh     = xnTraKetQuaChiTietVm.IDDonViTinh;
     xnTraKetQuaChiTietVm.KetLuan         = xnTraKetQuaChiTietVm.KetLuan;
     xnTraKetQuaChiTietVm.MaTiepNhan      = xnTraKetQuaChiTietVm.MaTiepNhan;
     xnTraKetQuaChiTietVm.MaPhieu         = xnTraKetQuaChiTietVm.MaPhieu;
     xnTraKetQuaChiTietVm.isDaDuyetKQ     = xnTraKetQuaChiTietVm.isDaDuyetKQ;
     xnTraKetQuaChiTietVm.isMauXNLai      = xnTraKetQuaChiTietVm.isMauXNLai;
     xnTraKetQuaChiTietVm.Stt             = xnTraKetQuaChiTietVm.Stt;
     xnTraKetQuaChiTietVm.isDongBo        = xnTraKetQuaChiTietVm.isDongBo;
     xnTraKetQuaChiTietVm.isXoa           = xnTraKetQuaChiTietVm.isXoa;
     xnTraKetQuaChiTietVm.IDNhanVienXoa   = xnTraKetQuaChiTietVm.IDNhanVienXoa;
     xnTraKetQuaChiTietVm.NgayGioXoa      = xnTraKetQuaChiTietVm.NgayGioXoa;
     xnTraKetQuaChiTietVm.MaDVCS          = xnTraKetQuaChiTietVm.MaDVCS;
     xnTraKetQuaChiTietVm.MaTrungTam      = xnTraKetQuaChiTietVm.MaTrungTam;
 }
Ejemplo n.º 2
0
        public HttpResponseMessage Create(HttpRequestMessage request, XN_TraKetQuaViewModel TraKetQuaVm)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;
                if (!ModelState.IsValid)
                {
                    response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState);
                }
                else
                {
                    var TraKetQua = new XN_TraKetQua();
                    TraKetQua.UpdateXN_TraKetQua(TraKetQuaVm);

                    this.xN_TraKetQuaService.AddUpd(TraKetQua);
                    foreach (var chitietVm in TraKetQuaVm.lstTraKetQuaChiTiet)
                    {
                        var TraKetQuaChiTiet = new XN_TraKQ_ChiTiet();
                        TraKetQuaChiTiet.UpdateXN_TraKetQuaChiTiet(chitietVm);
                        this.xN_TraKetQuaChiTietService.AddUpd(TraKetQuaChiTiet);
                    }
                    this.xN_TraKetQuaService.Save();
                    response = request.CreateResponse(HttpStatusCode.Created);
                }

                return response;
            }));
        }
        public void AddUpd(XN_TraKQ_ChiTiet xnTraKetQuaChiTiet)
        {
            var model = this.xN_TraKQ_ChiTietRepository.GetMulti(x => x.RowIDXN_TraKetQua_ChiTiet == xnTraKetQuaChiTiet.RowIDXN_TraKetQua_ChiTiet).FirstOrDefault();

            if (model != null)
            {
                this.xN_TraKQ_ChiTietRepository.Update(model);
            }
            else
            {
                this.xN_TraKQ_ChiTietRepository.Add(model);
            }
        }