コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
        private void btnlog_Click(object sender, EventArgs e)
        {
            try
            {
                con.connection();
                con.qurry("select * from log where UserName='******';");

                con.ad();
                String id = "";
                String pw = "";



                id = con.dt.Rows[0][2].ToString();
                pw = con.dt.Rows[0][1].ToString();
                con.dt.Clear();
                con.conclose();



                if (pw.Equals(txtp.Text))
                {
                    if (id.Equals("1"))
                    {
                        this.Hide();
                        admin a = new admin();
                        a.Show();
                    }
                    else
                    {
                        this.Hide();
                        home h = new home();
                        h.Show();
                    }
                }
                else
                {
                    ep_w.Clear();

                    ep_w.SetError(txtp, "enter correct password");
                }
            }



            catch (Exception)
            {
                ep_w.Clear();
                ep_w.SetError(txtu, "enter correct username");
                ep_w.SetError(txtp, "enter correct password");
                // MessageBox.Show("Check Your Username or Password");
            }
        }
コード例 #6
0
        /*  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);
            }
        }
コード例 #7
0
        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();
            }
        }
コード例 #8
0
 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);
     }
 }