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 btn_ane_insert_Click(object sender, EventArgs e) { if (txteno.Text == "") { txteno.BackColor = Color.Red; } else { try { pno = Convert.ToInt32(mtxt_pno.Text); con.connection(); con.qurry("insert into employee values('" + txteno.Text + "','" + txtename.Text + "','" + txteadd.Text + "','" + pno + "','" + dtp_dob.Text + "');"); con.nonqurry(); MessageBox.Show("insert"); con.conclose(); txteno.BackColor = Color.White; txteadd.Clear(); txtename.Clear(); txteno.Clear(); mtxt_pno.Clear(); } catch (Exception EX) { MessageBox.Show(EX.Message); } } }
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 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 button1_Click(object sender, EventArgs e) { con.connection(); con.qurry("delete from employee where eno='" + textBox1.Text + "';"); con.nonqurry(); MessageBox.Show("Delete!"); }
private void button3_Click(object sender, EventArgs e) { try { con.connection(); con.qurry("insert into item values('" + txtino.Text + "','" + txtiname.Text + "','" + txtiprice.Text + "','" + txticost.Text + "','" + txtqty.Text + "');"); con.nonqurry(); con.qurry("insert into sales_s values('" + txtino.Text + "','" + txtiname.Text + "',0,0,0);"); con.nonqurry(); MessageBox.Show("insert"); con.conclose(); } 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 textBox3_Click(object sender, EventArgs e) * { * lblprivrlege.Show(); * }*/ /* private void textBox3_MouseLeave(object sender, EventArgs e) * { * lblprivrlege.Hide(); * }*/ private void button1_Click(object sender, EventArgs e) { try { con.connection(); con.qurry("insert into log values('" + txtusername.Text + "','" + txtpass.Text + "','" + txtprivilege.Text + "');"); con.nonqurry(); MessageBox.Show("user created!"); con.conclose(); } catch (Exception EX) { MessageBox.Show(EX.Message); } }
private void button1_Click(object sender, EventArgs e) { try { con.connection(); con.qurry("delete from item where ino='" + txtino2.Text + "';"); con.nonqurry(); con.conclose(); MessageBox.Show("Deleted!"); } catch (Exception EX) { MessageBox.Show(EX.Message); } finally { txtino2.Clear(); txtino2.Focus(); } }
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); } }