Esempio n. 1
0
        public bool themHoaDon(DTO_HoaDon hdnew, DTO_KhachHang khnew, DTO_Thuoc tnew)
        {
            if (CheckIfExist(hdnew.MaHoaDon))
            {
                return(false);
            }


            HoaDon hdtemp = new HoaDon();

            hdtemp.Ma_Thuoc     = hdnew.MaThuoc;
            hdtemp.Ma_KhachHang = hdnew.MaKhach;
            DateTime date = Convert.ToDateTime(hdnew.NgayLap);

            hdtemp.NgayLap_HD = date;
            hdtemp.SoLuong_HD = hdnew.SoLuong;
            hdtemp.Loai_HD    = hdnew.LoaiHoaDon;


            db.HoaDons.InsertOnSubmit(hdtemp);
            db.SubmitChanges();
            return(true);
        }
 private void detach_HoaDons(HoaDon entity)
 {
     this.SendPropertyChanging();
     entity.KhachHang = null;
 }
 private void attach_HoaDons(HoaDon entity)
 {
     this.SendPropertyChanging();
     entity.KhachHang = this;
 }
 partial void DeleteHoaDon(HoaDon instance);
 partial void UpdateHoaDon(HoaDon instance);
 partial void InsertHoaDon(HoaDon instance);