Esempio n. 1
0
        public void UpdateGridView()
        {
            SalesmanService ss = new SalesmanService();

            dataGridView1.DataSource = ss.GetAll();
            //dataGridView1.Columns[0].Visible = false;
        }
Esempio n. 2
0
        private void SalesmanPage_Load(object sender, EventArgs e)
        {
            SalesmanService ss = new SalesmanService();

            dataGridView1.DataSource         = ss.GetAll();
            dataGridView1.Columns[0].Visible = false;
        }
Esempio n. 3
0
        private void btnComplete_Click(object sender, EventArgs e)
        {
            SalesmanService salesmanService = new SalesmanService();
            string          itemName        = txtItem.Text;
            int             quan            = Convert.ToInt32(txtQuantity.Text);
            int             earn            = Convert.ToInt32(txtPayment.Text);
            int             sId             = user.UserID;

            int result = salesmanService.InsertSold(itemName, quan, earn, sId);

            if (result > 0)
            {
                MessageBox.Show("Insert complete.");
                dataGridView1.Enabled = true;
                Clear();
            }
            else
            {
                MessageBox.Show("Error!!");
            }
        }
Esempio n. 4
0
        private void btnAccpet_Click(object sender, EventArgs e)
        {
            SalesmanService ss = new SalesmanService();

            if (txtItem.Text != "")
            {
                int result = ss.Delete(id);
                if (result > 0)
                {
                    UpdateGridView();
                    dataGridView1.Enabled = false;
                    MessageBox.Show("Deleted");
                }
                else
                {
                    MessageBox.Show("Delete Error!!");
                }
            }
            else
            {
                MessageBox.Show("Select an item first.");
            }
        }