protected void btnAdd_Click(object sender, ImageClickEventArgs e) { InventoryManager inventoryManager = new InventoryManager(this); InventorySerial inventorySerial = new InventorySerial(); inventorySerial.CompanyId = Company.CompanyId; inventorySerial.DepositId = depositId; if (ucDtDueDate.DateTime.HasValue) inventorySerial.DueDate = ucDtDueDate.DateTime.Value.Date; inventorySerial.Lot = txtLot.Text; inventorySerial.Serial = txtSerial.Text; inventorySerial.InventoryId = inventoryId; inventoryManager.InsertInventorySerial(inventorySerial); grdInventorySerial.DataBind(); }
protected void btnAdd_Click(object sender, ImageClickEventArgs e) { InventoryManager inventoryManager = new InventoryManager(this); InventorySerial inventorySerial = new InventorySerial(); inventorySerial.CompanyId = Company.CompanyId; inventorySerial.DepositId = depositId; if (ucDtDueDate.DateTime.HasValue) { inventorySerial.DueDate = ucDtDueDate.DateTime.Value.Date; } inventorySerial.Lot = txtLot.Text; inventorySerial.Serial = txtSerial.Text; inventorySerial.InventoryId = inventoryId; inventoryManager.InsertInventorySerial(inventorySerial); grdInventorySerial.DataBind(); }
/// <summary> /// this method Insert the InventorySerial /// </summary> /// <param name="entity"></param> public void InsertInventorySerial(InventorySerial entity) { DbContext.InventorySerials.InsertOnSubmit(entity); DbContext.SubmitChanges(); }