Ejemplo n.º 1
0
        private void Sales_Orders_Load(object sender, EventArgs e)
        {
            txtdate.Text = System.DateTime.Today.ToString("M/d/yyyy");

            DBItem        s = new DBItem();
            SqlDataReader DR;

            DR = s.getName();
            while (DR.Read())
            {
                cmbitemname.Items.Add(DR[0]);
            }
        }
        private void cmbsorder_SelectedIndexChanged(object sender, EventArgs e)
        {
            int so_no = Convert.ToInt32(cmbsorder.SelectedItem);
            DBSales_Item_reference si = new DBSales_Item_reference();

            DR = si.getItems(so_no);
            int    itemno;
            String itemname = "";

            while (DR.Read())
            {
                itemno = Convert.ToInt32(DR[0]);
                DBItem i = new DBItem();
                DR2 = i.getName(itemno);
                while (DR2.Read())
                {
                    itemname = DR2[0].ToString();
                }
                cmbitemname.Items.Add(itemname);
            }
        }
        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DBItem i      = new DBItem();
            int    itemno = Convert.ToInt32(dataGridView2.CurrentRow.Cells["Item_No"].Value);

            DR = i.getName(itemno);
            while (DR.Read())
            {
                metroTextBox1.Text = DR[0].ToString();
            }
            int Qty = Convert.ToInt32(dataGridView2.CurrentRow.Cells["Item_Qty"].Value);

            /* DBPurchases pu = new DBPurchases();
             * DR = pu.getQty(metroTextBox1.Text.ToString());
             * while (DR.Read())
             * {
             *   Qty = Convert.ToInt32(DR[0]);
             *
             * } */
            numQty.Maximum = Qty;
            numQty.Value   = Qty;
        }