Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int t = controllerObj.AddBranch(textBox1.Text, textBox2.Text);

            if (t >= 1)
            {
                MessageBox.Show("Branch added");
                DataTable dt = controllerObj.GetAllProductID();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string pid = dt.Rows[i][0].ToString();
                    controllerObj.InsertProductinBranchHas(pid, textBox1.Text);
                    controllerObj.InsertProductinBranchSold(pid, textBox1.Text);
                }
            }
            else
            {
                MessageBox.Show("Failed, maybe branch_name exists or missing data to fill");
            }
        }