private void IssueTON_Load(object sender, EventArgs e) { TransferOutNote ton = new TransferOutNote(); //Get Date txtDate.Text = DateTime.Now.ToString(); Database db = new Database(); db.inserUpdateDelete("delete from tonTemp"); //Get TON ID string id; id = ton.getMaxId(); if (string.IsNullOrEmpty(id)) { txtTONNo.Text = "1"; } else { txtTONNo.Text = (Convert.ToInt32(id) + 1).ToString(); } Database db1 = new Database(); //Fill Combo Item item = new Item(); dt1 = item.getItemDetails(); cmbItemCode.DataSource = dt1; cmbItemCode.ValueMember = "itemID"; cmbItemName.DataSource = dt1; cmbItemName.ValueMember = "itemName"; dt2 = db1.select("select * from warehouses"); cmbDestination.DataSource = dt2; cmbDestination.ValueMember = "location"; }
private void btnIssue_Click(object sender, EventArgs e) { TransferOutNote ton = new TransferOutNote(); ton.FromLocation = txtFromLocation.Text; ton.Destination = cmbDestination.Text; ton.Id = Convert.ToInt32(txtTONNo.Text); ton.addTON(); MessageBox.Show("TON added successfully!"); this.Close(); }