protected void Sell_Click(object sender, EventArgs e) { success.Text = "okk"; PurProps sp = new PurProps(); 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_pur_by = soldby.Text.ToString(); sp.P_supplyer = supply.SelectedItem.ToString(); PurBLL sb = new PurBLL(); if (sb.PurcBLL(sp)) { Response.Write("<script>alert('Transection Successfull')</script>"); trxid.Text = ""; products.SelectedIndex = 0; price.Text = ""; quantaty.Text = ""; date.Text = ""; soldby.Text = ""; supply.SelectedIndex = 0; } else { Response.Write("<script>alert('Transection Unsuccessfull')</script>"); } }
public bool PurcDAL(PurProps 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 purchases values ('" + s.Trx_id + "','" + s.P_title + "','" + s.P_price + "','" + s.P_quantity + "','" + s.P_date + "','" + s.P_pur_by + "','" + s.P_supplyer + "'); "; if (db.query_iud(query2)) { check = true; } else { check = false; } } else { check = false; } return(check); }
public bool PurcBLL(PurProps p) { PurDAL obj = new PurDAL(); return(obj.PurcDAL(p)); }