Exemple #1
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            product = new KreationService.Product();
            try
            {
                string id    = txtBox_ID.Text;
                int    qty   = Convert.ToInt16(txtBox_Qty.Text);
                int    price = client.GetPrice(id);
                string name  = client.Name(id);

                int total = (qty * price);


                product.invoiceno = textBox1.Text;
                product.barcode   = txtBox_ID.Text;
                product.name      = name;
                product.qty       = Convert.ToString(qty);
                product.price     = Convert.ToString(price);
                product.total     = Convert.ToString(total);

                client.InsertPos(product);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            load_gridview();
            dataGridView_pos.Update();
            dataGridView_pos.Refresh();
        }
Exemple #2
0
        private void txtBox_Delete_Click(object sender, EventArgs e)
        {
            product         = new KreationService.Product();
            product.barcode = txtBox_ID.Text;

            client.delete_item(product);

            load_gridview();
            dataGridView_pos.Update();
            dataGridView_pos.Refresh();
        }