public void return_product(Return_Product_Form re) { string constr = "data source = orcl; user id = hr; password=hr;"; string productt = "select QUANTITY from PRODUCT where P_NAME= '" + re.textBox_product_name.Text.ToString() + "'"; adapteer = new OracleDataAdapter(productt, constr); dataSeett = new DataSet(); adapteer.Fill(dataSeett); this.setQuantity(int.Parse(dataSeett.Tables[0].Rows[0]["QUANTITY"].ToString()) + 1); this.setName(re.textBox_product_name.Text); string constrr = "data source = orcl; user id = hr; password=hr;"; string produt = "update PRODUCT set QUANTITY = " + getQuantity() + " where P_NAME ='" + getName() + "'"; adapter = new OracleDataAdapter(produt, constrr); dataSett = new DataSet(); adapter.Fill(dataSett); }
public void calc_new_Price(Return_Product_Form re) { bill bil = new bill(); OracleDataAdapter adaptt; DataSet dataStt; string constrr = "data source = orcl; user id = hr; password=hr;"; string produtt = "select PRICE from PRODUCT where P_NAME='" + re.textBox_product_name.Text.ToString() + "'"; adaptt = new OracleDataAdapter(produtt, constrr); dataStt = new DataSet(); adaptt.Fill(dataStt); ///////////////////////////////////////////////// OracleDataAdapter adapttr; DataSet dataSstt; string consttrr = "data source = orcl; user id = hr; password=hr;"; string produut = "select TOTAL_PRICE from BILL where BILL_ID= " + int.Parse(re.Select_Bill_ID_for_return_bill.SelectedItem.ToString()); adapttr = new OracleDataAdapter(produut, consttrr); dataSstt = new DataSet(); adapttr.Fill(dataSstt); ///////////////////////////////////////////////////////// float Totalprice = float.Parse(dataSstt.Tables[0].Rows[0]["TOTAL_PRICE"].ToString()) - float.Parse(dataStt.Tables[0].Rows[0]["PRICE"].ToString()); bil.setTotle_price(Totalprice); ////////////////////////////////////////////////// OracleDataAdapter adapt; DataSet dataSt; string constttrr = "data source = orcl; user id = hr; password=hr;"; string prod = "update BILL set TOTAL_PRICE = " + bil.getTotle_price() + " where BILL_ID =" + int.Parse(re.Select_Bill_ID_for_return_bill.SelectedItem.ToString()); adapt = new OracleDataAdapter(prod, constttrr); dataSt = new DataSet(); adapt.Fill(dataSt); }
private void button1_Click(object sender, EventArgs e) { Return_Product_Form ret = new Return_Product_Form(); ret.Show(); }