private void emp_view_Load(object sender, EventArgs e) { con.connection(); con.qurry("select eno as 'Employee NO',ename as 'Name', eaddress as 'Address',ephone_no as 'Phone NO',dob as 'Date of birth' from employee;"); con.ad(); dataGridView1.DataSource = con.dt; con.conclose(); }
private void stock_view_Load(object sender, EventArgs e) { con.connection(); con.qurry("select ino as 'Item ON',iname as 'Item Name',iprice as 'Item Price',icost as 'Item Cost',no_of_item as 'NO of Items' from item;"); con.ad(); dataGridView1.DataSource = con.dt; con.conclose(); }
private void button1_Click(object sender, EventArgs e) { try { con.connection(); con.qurry("select * from log where UserName='******';"); con.ad(); String pw = ""; pw = con.dt.Rows[0][1].ToString(); //con.dt.Clear(); if (pw.Equals(txtoldpass2.Text)) { con.qurry("update log set password='******' where UserName='******';"); con.nonqurry(); MessageBox.Show("Password Change!"); } else { MessageBox.Show("Check Ysername or Password"); } } catch (Exception EX) { MessageBox.Show(EX.Message); } }
private void Form1_Load(object sender, EventArgs e) { try { con.connection(); con.qurry("select * from log;"); con.ad(); String ch = ""; ch = con.dt.Rows[0][0].ToString(); } catch (IndexOutOfRangeException) { admin a = new admin(); a.Show(); this.Hide(); } }
private void btn_ok_Click(object sender, EventArgs e) { try { con.connection(); con.qurry("select * from item where ino='" + txtino.Text + "';"); String price = ""; String cost = ""; String name = ""; int q1 = Convert.ToInt32(txtqty.Text); con.ad(); price = con.dt.Rows[0][2].ToString(); cost = con.dt.Rows[0][3].ToString(); name = con.dt.Rows[0][1].ToString(); double p = double.Parse(price); double c = double.Parse(cost); double totcost = (c * q1); double subtotal = (p * q1); decimal tcc = (decimal)totcost; decimal stt = (decimal)subtotal; gtot = gtot + stt; txtiname.Text = name; txt_gross_amo.Text = gtot.ToString(); txtsubtot.Text = subtotal.ToString(); con.qurry("update item set no_of_item=(no_of_item-'" + txtqty.Text + "') where ino='" + txtino.Text + "';"); con.nonqurry(); con.qurry("update sales_s set item_name='" + txtiname.Text + "', item_price=(item_price+ '" + stt + "') ,item_cost=(item_cost+ '" + tcc + "'),no_of_s=(no_of_s+ '" + q1 + "') where item_no='" + txtino.Text + "';"); con.nonqurry(); lst_bill.Items.Add(string.Format("{0} ", txtiname.Text)); lst_bill.Items.Add(string.Format(" X {0} RS.{1} ", txtqty.Text, txtsubtot.Text)); } catch (Exception EX) { MessageBox.Show(EX.Message); } }
private void sales_Load(object sender, EventArgs e) { try { con.connection(); con.qurry("select item_no as 'Item NO',item_name as 'Item Name',item_price as 'Total Income',item_cost as 'Total Cost',no_of_s as 'Sold Items' from sales_s;"); con.ad(); dataGridView1.DataSource = con.dt; con.conclose(); } catch (Exception EX) { MessageBox.Show(EX.Message); } }