コード例 #1
0
 public ChiTietPhieuXuat(CHITIETPHIEUXUAT chitiet)
 {
     MaSoPhieuXuat = chitiet.masophieuxuat;
     MaSoSach = chitiet.masosach;
     SoLuong = chitiet.soluong;
     DonGia = chitiet.dongia;
     TrangThai = chitiet.trangthai;
 }
コード例 #2
0
 partial void DeleteCHITIETPHIEUXUAT(CHITIETPHIEUXUAT instance);
コード例 #3
0
 partial void UpdateCHITIETPHIEUXUAT(CHITIETPHIEUXUAT instance);
コード例 #4
0
 partial void InsertCHITIETPHIEUXUAT(CHITIETPHIEUXUAT instance);
コード例 #5
0
		private void detach_CHITIETPHIEUXUATs(CHITIETPHIEUXUAT entity)
		{
			this.SendPropertyChanging();
			entity.SACH = null;
		}
コード例 #6
0
		private void attach_CHITIETPHIEUXUATs(CHITIETPHIEUXUAT entity)
		{
			this.SendPropertyChanging();
			entity.PHIEUXUAT = this;
		}
コード例 #7
0
 public ChiTietPhieuXuat(CHITIETPHIEUXUAT chitiet, SACH sach)
     : this(chitiet)
 {
     Sach = new Sach(sach);
 }
コード例 #8
0
 public static bool add(ChiTietPhieuXuat chitiet, int masophieuxuat)
 {
     try
     {
         using (EntitiesDataContext db = new EntitiesDataContext())
         {
             CHITIETPHIEUXUAT ct;
             ct = (from c in db.CHITIETPHIEUXUATs
                   where c.masophieuxuat.Equals(masophieuxuat)
                   && c.masosach.Equals(chitiet.MaSoSach)
                   select c).SingleOrDefault();
             if (ct != null) return false;
             ct = new CHITIETPHIEUXUAT
             {
                 masophieuxuat = masophieuxuat,
                 masosach = chitiet.MaSoSach,
                 soluong = chitiet.SoLuong,
                 dongia = chitiet.DonGia,
                 trangthai = chitiet.TrangThai == null ? 0 : 1
             };
             db.CHITIETPHIEUXUATs.InsertOnSubmit(ct);
             db.SubmitChanges();
             return true;
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return false;
     }
 }