Пример #1
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            connection CN = new connection();

            CN.thisConnection.Open();

            OracleCommand thisCommand = CN.thisConnection.CreateCommand();

            textBox2.Text = "";
            textBox3.Text = "";

            thisCommand.CommandText =
                "SELECT * FROM member where id = '" + textBox1.Text + "'";

            OracleDataReader thisReader = thisCommand.ExecuteReader();


            while (thisReader.Read())
            {
                textBox2.Text = thisReader["name"].ToString();
                textBox3.Text = thisReader["cash"].ToString();


                try
                {
                    // string filePath = thisReader["picture"].ToString();
                    // this.pb_profilepics.Image = Image.FromFile(filePath);
                }
                catch
                { MessageBox.Show("Failure"); }
            }
            CN.thisConnection.Close();
        }
Пример #2
0
        public void update_stock()
        {
            connection con = new connection();
            string     ConnectionString = con.ConnectionString;

            OleDbConnection conn = new OleDbConnection(ConnectionString);
            OleDbCommand    comm = new OleDbCommand(@"UPDATE stock
                                                   SET receive_qty = @receive_qty
                                                  WHERE item_code = @item_code", conn);

            comm.Parameters.AddWithValue("@receive_qty", invoice.qty);
            comm.Parameters.AddWithValue("@item_code", invoice.code);


            try
            {
                conn.Open();
                comm.ExecuteNonQuery();
            }
            catch (Exception tp)
            {
                MessageBox.Show("update stock" + tp);
            }
            finally
            {
                conn.Close();
            }
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();

            OracleCommand thisCommand = sv.thisConnection.CreateCommand();

            thisCommand.CommandText =
                "update member set name = '" + textBox2.Text + "',cash='" + textBox3.Text + "'  where id= '" + textBox1.Text + "'";

            thisCommand.Connection  = sv.thisConnection;
            thisCommand.CommandType = CommandType.Text;
            //For Insert Data Into Oracle//
            try
            {
                thisCommand.ExecuteNonQuery();
                MessageBox.Show("Updated");
                this.Hide();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            sv.thisConnection.Close();
            this.Close();

            Form1 ob = new Form1();

            ob.Show();
        }
Пример #4
0
        public sales_return_print()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
        }
Пример #5
0
        public void getstock()
        {
            connection con = new connection();
            string     ConnectionString = con.ConnectionString;

            string          strsql = "select * from stock where  (item_code = @id)";
            OleDbConnection conn   = new OleDbConnection(ConnectionString);
            OleDbCommand    cmd    = new OleDbCommand(strsql, conn);

            cmd.Parameters.AddWithValue("@id", invoice.code.ToString());

            try
            {
                conn.Open();
                OleDbDataReader reader = cmd.ExecuteReader();

                if (reader.Read())
                {
                    stock = Convert.ToInt32(reader["receive_qty"].ToString());
                }
            }
            catch (Exception tp)
            {
                MessageBox.Show("" + tp);
            }
            finally
            {
                conn.Close();
            }
        }
Пример #6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            connection CN = new connection();

            CN.thisConnection.Open();

            OracleCommand thisCommand = CN.thisConnection.CreateCommand();

            thisCommand.CommandText =
                "SELECT * FROM member ";

            OracleDataReader thisReader = thisCommand.ExecuteReader();

            ct = 0;

            while (thisReader.Read())
            {
                ListViewItem lsvItem = new ListViewItem(thisReader["name"].ToString());

                ct++;

                lsvItem.SubItems.Add(thisReader["cash"].ToString());
                listView1.Items.Add(lsvItem);
            }


            CN.thisConnection.Close();

            label1.Text = ct.ToString();
        }
Пример #7
0
        public change_pass()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
        }
Пример #8
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            listView1.Items.Clear();
            connection CN = new connection();

            CN.thisConnection.Open();

            OracleCommand thisCommand = CN.thisConnection.CreateCommand();

            thisCommand.CommandText =
                "SELECT * FROM member ";

            OracleDataReader thisReader = thisCommand.ExecuteReader();



            while (thisReader.Read())
            {
                ListViewItem lsvItem = new ListViewItem(thisReader["name"].ToString());
                lsvItem.SubItems.Add(thisReader["id"].ToString());
                lsvItem.SubItems.Add(label1.Text);
                lsvItem.SubItems.Add(textBox1.Text);

                listView1.Items.Add(lsvItem);
            }
            CN.thisConnection.Close();
        }
Пример #9
0
        public invoice_print()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
        }
Пример #10
0
        public stock_receipt_print()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
        }
Пример #11
0
        public p_order_print()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
        }
Пример #12
0
        private void addbalance_Load(object sender, EventArgs e)
        {
            textBox4.Enabled = false;
            connection CN = new connection();

            CN.thisConnection.Open();

            OracleCommand thisCommand = CN.thisConnection.CreateCommand();

            thisCommand.CommandText =
                "SELECT * FROM member ";

            OracleDataReader thisReader = thisCommand.ExecuteReader();


            while (thisReader.Read())
            {
                ListViewItem lsvItem = new ListViewItem(thisReader["name"].ToString());
                lsvItem.SubItems.Add(thisReader["id"].ToString());
                lsvItem.SubItems.Add(thisReader["cash"].ToString());

                listView1.Items.Add(lsvItem);
            }


            CN.thisConnection.Close();
        }
Пример #13
0
        public item_a()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
        }
Пример #14
0
        private void dailymeal_Load(object sender, EventArgs e)
        {
            //meal table
            connection cd = new connection();

            cd.thisConnection.Open();

            OracleCommand thisCommand1 = cd.thisConnection.CreateCommand();

            thisCommand1.CommandText =
                "SELECT * FROM meal ";

            OracleDataReader thisReader1 = thisCommand1.ExecuteReader();

            Boolean x;

            if (x = thisReader1.Read())
            {
                while (thisReader1.Read())
                {
                    daycount = Convert.ToInt32(thisReader1["day"].ToString());
                }


                cd.thisConnection.Close();
                daycount++;
            }
            else
            {
                daycount = 1;
            }


            label1.Text = daycount.ToString();
/// member table
            connection CN = new connection();

            CN.thisConnection.Open();

            OracleCommand thisCommand = CN.thisConnection.CreateCommand();

            thisCommand.CommandText =
                "SELECT * FROM member ";

            OracleDataReader thisReader = thisCommand.ExecuteReader();



            while (thisReader.Read())
            {
                ListViewItem lsvItem = new ListViewItem(thisReader["name"].ToString());
                lsvItem.SubItems.Add(thisReader["id"].ToString());
                lsvItem.SubItems.Add(label1.Text);
                lsvItem.SubItems.Add(textBox1.Text);

                listView1.Items.Add(lsvItem);
            }
            CN.thisConnection.Close();
        }
Пример #15
0
        public stockissue()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            gridview();
        }
Пример #16
0
        public group()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
        }
Пример #17
0
        public i_b_m_s()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            gridview();
        }
Пример #18
0
        public payment_due_list()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
        }
Пример #19
0
        public due_invoice()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            gridview();
        }
Пример #20
0
        public taxsetup()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            BindGrid();
        }
Пример #21
0
        public Form1()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            textbox();
        }
Пример #22
0
        public sales_retuen_issue()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            gridview();
        }
Пример #23
0
        public sale_item()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
        }
Пример #24
0
        public city()
        {
            InitializeComponent();
            this.AutoValidate = System.Windows.Forms.AutoValidate.Disable;
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            gridview();
        }
Пример #25
0
        public payment_re()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
            dateTimePicker1.Value = DateTime.Now;
            dateTimePicker2.Value = DateTime.Now;
            reecipt();
        }
Пример #26
0
        public p_order()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;

            gridview();
            dateTimePicker1.Value = DateTime.Now.Date;
            dateTimePicker2.Value = DateTime.Now.Date;
        }
Пример #27
0
        public stock_r_n()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
            dateTimePicker1.Value = DateTime.Now;
            dateTimePicker2.Value = DateTime.Now;
            dateTimePicker3.Value = DateTime.Now;
        }
Пример #28
0
        public invoice()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
            dateTimePicker1.Value = DateTime.Now;
            dateTimePicker2.Value = DateTime.Now;
            getid();
        }
Пример #29
0
        private void button1_Click(object sender, EventArgs e)
        {
            /////
            for (int x = 0; x < listView1.Items.Count; x++)
            //    ListView1.Items.Count - 1; x++)
            {
                connection sv = new connection();
                sv.thisConnection.Open();

                OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM meal", sv.thisConnection);

                OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter);

                DataSet thisDataSet = new DataSet();
                thisAdapter.Fill(thisDataSet, "meal");

                DataRow thisRow = thisDataSet.Tables["meal"].NewRow();
                try
                {
                    //MessageBox.Show(listView1.Items[x].SubItems[0].Text);


                    thisRow["id"]   = listView1.Items[x].SubItems[1].Text;
                    thisRow["name"] = listView1.Items[x].SubItems[0].Text;
                    thisRow["day"]  = listView1.Items[x].SubItems[2].Text;
                    thisRow["meal"] = listView1.Items[x].SubItems[3].Text;


                    thisDataSet.Tables["meal"].Rows.Add(thisRow);



                    thisAdapter.Update(thisDataSet, "meal");
                }



                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                sv.thisConnection.Close();
            }


            //////

            MessageBox.Show("Submitted");
            Form1 ob = new Form1();

            ob.Show();
            this.Hide();
        }
Пример #30
0
        public sales_order()
        {
            InitializeComponent();
            connection con = new connection();

            connection.ConnectionString = con.ConnectionString;
            grid();
            dateTimePicker1.Value = DateTime.Now;
            dateTimePicker3.Value = DateTime.Now;
            dateTimePicker4.Value = DateTime.Now;
            getid();
        }