protected void Sell_Click(object sender, EventArgs e) { success.Text = "okk"; SellProps sp = new SellProps(); sp.Trx_id = trxid.Text.ToString(); sp.P_title = products.SelectedItem.ToString(); sp.P_price = price.Text.ToString(); sp.P_quantity = quantaty.Text.ToString(); sp.P_date = date.Text.ToString(); sp.P_sold_by = soldby.Text.ToString(); SellBLL sb = new SellBLL(); if (sb.sellBLL(sp)) { Response.Write("<script>alert('Transection Successfull')</script>"); } else { Response.Write("<script>alert('Transection Unsuccessfull')</script>"); } trxid.Text = ""; products.SelectedIndex = 0; price.Text = ""; quantaty.Text = ""; date.Text = ""; soldby.Text = ""; }
public bool sellDAL(SellProps s) { bool check = false; String query1 = "update products set prd_stock = prd_stock-" + Convert.ToInt32(s.P_quantity) + " where prd_title = '" + s.P_title + "';"; if (db.query_iud(query1)) { String query2 = "insert into sells values ('" + s.Trx_id + "','" + s.P_title + "','" + s.P_price + "','" + s.P_quantity + "','" + s.P_date + "','" + s.P_sold_by + "'); "; if (db.query_iud(query2)) { check = true; } else { check = false; } } else { check = false; } return(check); }
public bool sellBLL(SellProps p) { SellDAL obj = new SellDAL(); return(obj.sellDAL(p)); }