private void NewStockbtn_Click(object sender, EventArgs e) { if (StockQuntity.Text == String.Empty || StockPrice.Text == String.Empty) { MessageBox.Show("Fill all Fields", "Required", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { ServiceStock.Stock s = new ServiceStock.Stock(); s.Name = StockName.Text; s.Quantity = Int32.Parse(StockQuntity.Text); s.Price = Int32.Parse(StockPrice.Text); s.DOM = StockDOM.Value; s.Available = s.Quantity; s.Branch_Id = Br_Id[BranchList.SelectedIndex]; ServiceStock.Stock data = new ServiceStock.Stock(); data = ss.addStock(s); if (data != null) { MessageBox.Show("Stock added successfully", "INFO!", MessageBoxButtons.OK, MessageBoxIcon.Information); load_data(); All.BringToFront(); } else { MessageBox.Show("Try Again some thing wents wrong", "INFO!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void NewStock_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { s = null; Add.BringToFront(); }