コード例 #1
0
        public bool DeleteProduct(bill_detail bd)
        {
            try
            {
                db.bill_details.DeleteOnSubmit(bd);
                db.SubmitChanges();
                return true;

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
 private void btnThemTrai_Click(object sender, EventArgs e)
 {
     btnLuuCT.Enabled = true;
     if (gvSanPham.SelectedRowsCount == 0) return;
     product p = (product)gvSanPham.GetFocusedRow();
     if (busHoaDon.KiemTraTonTai(b, p))
     {
         XtraMessageBox.Show("Sản phẩm đã tồn tại!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
         return;
     }
     bill_detail bd = new bill_detail();
     bd.id = b.id + p.id;
     bd.created = DateTime.Now;
     bd.quantity = (int)spSoLuong.Value;
     bd.monetized = (int)(spSoLuong.Value * p.price);
     bd.product = p;
     bd.bill = b;
     dgvCTPhieuBaoGia.DataSource = busHoaDon.GetProduct(b);
 }
コード例 #3
0
		private void detach_bill_details(bill_detail entity)
		{
			this.SendPropertyChanging();
			entity.bill = null;
		}
コード例 #4
0
 partial void Deletebill_detail(bill_detail instance);
コード例 #5
0
 partial void Updatebill_detail(bill_detail instance);
コード例 #6
0
 partial void Insertbill_detail(bill_detail instance);
コード例 #7
0
		private void attach_bill_details(bill_detail entity)
		{
			this.SendPropertyChanging();
			entity.product = this;
		}