コード例 #1
0
ファイル: CTNhapSachDAL.cs プロジェクト: BuiDinhDuc/DoAn
        public void Update_ThanhTien(string MaNhap)
        {
            NhapSach nhapSach = new NhapSach();

            nhapSach = data.NhapSaches.SingleOrDefault(u => u.MaNhap == MaNhap);

            nhapSach.ThanhTien = TinhThanhTien(MaNhap);
        }
コード例 #2
0
ファイル: NhapSachDAL.cs プロジェクト: BuiDinhDuc/DoAn
        public bool _NhapSach(NhapSachDTO nhapSachDTO)
        {
            try
            {
                NhapSach nhapSach = new NhapSach();
                nhapSach.MaNhap    = nhapSachDTO.MaNhap;
                nhapSach.MaNV      = nhapSachDTO.MaNV;
                nhapSach.NgayNhap  = nhapSachDTO.NgayNhap;
                nhapSach.ThanhTien = 0;
                nhapSach.TrangThai = true;
                data.NhapSaches.Add(nhapSach);
                data.SaveChanges();


                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }