Ejemplo n.º 1
0
        public frmInventory(frmPrincipal f)
        {
            InitializeComponent();
            frmprincipal = f;

            string selected = frmprincipal.lstbox_products.SelectedItem.ToString();
            string sql      = "SELECT * FROM tb_products WHERE PRODUCT_NAME='" + selected + "'";

            dt = database.DataBaseCommand(sql);
            nud_product_amount.Value = decimal.Parse(dt.Rows[0].ItemArray[3].ToString());
        }
Ejemplo n.º 2
0
        public frmUpdateProduct(frmPrincipal f)
        {
            // Creating new DataTable for using with database command
            DataTable dt = new DataTable();

            InitializeComponent();
            frmprincipal = f;

            txtbox_productName.Text = frmprincipal.lstbox_products.SelectedItem.ToString();
            string selected = frmprincipal.lstbox_products.SelectedItem.ToString();
            string sql      = "SELECT * FROM tb_products WHERE PRODUCT_NAME='" + selected + "'";

            dt = database.DataBaseCommand(sql);
            txtbox_productPrice.Text = dt.Rows[0].ItemArray[2].ToString();
            nudProductAmount.Value   = decimal.Parse(dt.Rows[0].ItemArray[3].ToString());
        }
Ejemplo n.º 3
0
 public frmLogin(frmPrincipal f)
 {
     InitializeComponent();
     frmprincipal = f;
 }