public bool SaveInvoiceDetail(List<InvoiceDetailModel> invoiceDetailModellist, int invoiceid) { try { using (_context= new HSSNInventoryEntities() ) { foreach (var rowData in invoiceDetailModellist) { var model = new InvoiceDetail() { ProductId = rowData.ProductId, InvoiceId =invoiceid , Quantity = rowData.Quantity, Rate = rowData.Rate, }; _context.Entry(model).State = EntityState.Added; } _context.SaveChanges(); return true; } } catch (Exception) { throw; } }
private void detach_InvoiceDetails(InvoiceDetail entity) { this.SendPropertyChanging(); entity.ClientDetail = null; }
private void attach_InvoiceDetails(InvoiceDetail entity) { this.SendPropertyChanging(); entity.PersonalDetail = this; }
partial void DeleteInvoiceDetail(InvoiceDetail instance);
partial void UpdateInvoiceDetail(InvoiceDetail instance);
partial void InsertInvoiceDetail(InvoiceDetail instance);