public SoldProductForm()
        {
            InitializeComponent();
            if (LoginForm.USERTYPE == "hqmanager")
            {
                BranchCollection obj = new BranchCollection();
                obj.LoadAll();
                BranchnamecomboBox1.DataSource    = obj.LoadedTable;
                BranchnamecomboBox1.ValueMember   = "Branch_ID";
                BranchnamecomboBox1.DisplayMember = "Branch_Name";
                Branchnamelabel2.Visible          = false;


                BranchProductColletion bpc = new BranchProductColletion();
                bpc.LoadAll();
                productidcomboBox2.DataSource    = bpc.LoadedTable;
                productidcomboBox2.DisplayMember = "PName";
                productidcomboBox2.ValueMember   = "PID";
                SoldproducCollection sp = new SoldproducCollection();
                sp.LoadAll();
                datecomboBox3.DataSource    = sp.LoadedTable;
                datecomboBox3.ValueMember   = "Sold_Date";
                datecomboBox3.DisplayMember = "Sold_Date";

                SupplierCollection sc = new SupplierCollection();
                sc.LoadAll();
                supplieridcomboBox4.DataSource    = sc.LoadedTable;
                supplieridcomboBox4.ValueMember   = "Supplier_ID";
                supplieridcomboBox4.DisplayMember = "Supplier_Name";
            }
            else if (LoginForm.USERTYPE == "manager")
            {
                Branchnamelabel2.Text       = LoginForm.BNAME;
                BranchnamecomboBox1.Visible = false;

                BranchProductColletion bpc = new BranchProductColletion();

                bpc.LoadAll2(LoginForm.BRCHID);
                productidcomboBox2.DataSource    = bpc.LoadedTable;
                productidcomboBox2.DisplayMember = "PName";
                productidcomboBox2.ValueMember   = "PID";
                SoldproducCollection sp = new SoldproducCollection();
                sp.LoadAll();
                datecomboBox3.DataSource    = sp.LoadedTable;
                datecomboBox3.ValueMember   = "Sold_Date";
                datecomboBox3.DisplayMember = "Sold_Date";

                SupplierCollection sc = new SupplierCollection();
                sc.LoadAll();
                supplieridcomboBox4.DataSource    = sc.LoadedTable;
                supplieridcomboBox4.ValueMember   = "Supplier_ID";
                supplieridcomboBox4.DisplayMember = "Supplier_Name";
            }
        }
        private void SalesForm_Load(object sender, EventArgs e)
        {
            BranchProductColletion obj22 = new BranchProductColletion();

            obj22.LoadAll();

            ProductNamecomboBox1.DataSource    = obj22.LoadedTable;
            ProductNamecomboBox1.DisplayMember = "PName";
            ProductNamecomboBox1.ValueMember   = "PID";
            Branch_Product bp = new Branch_Product();

            bp.Productid = Convert.ToInt32(ProductNamecomboBox1.SelectedValue);
            bp.BranchId  = LoginForm.BRCHID;
            bp.ptype2();
            quantitytextBox1.Text  = bp.Quantity.ToString();
            unitpricetextBox2.Text = bp.SalesPrice.ToString();

            Branchnamelabel.Text = LoginForm.BNAME;
            datetextBox1.Text    = DateTime.Today.Date.ToShortDateString();
        }
        public Branch_Inventory()
        {
            InitializeComponent();
            if (LoginForm.USERTYPE == "hqmanager")
            {
                BranchIDlabel13.Visible = false;
                BranchCollection obj1 = new BranchCollection();
                obj1.LoadAll();
                BranchcomboBox1.DataSource    = obj1.LoadedTable;
                BranchcomboBox1.DisplayMember = "Branch_Name";
                BranchcomboBox1.ValueMember   = "Branch_ID";
            }
            else
            {
                BranchcomboBox1.Visible = false;
                BranchIDlabel13.Text    = LoginForm.BNAME;
            }
            BranchProductColletion obj22 = new BranchProductColletion();

            obj22.LoadAll();
            comboBox1.DataSource    = obj22.LoadedTable;
            comboBox1.DisplayMember = "PName";
            comboBox1.ValueMember   = "PID";
        }
 private void ShowallButton_Click(object sender, EventArgs e)
 {
     if (LoginForm.USERTYPE == "hqmanager")
     {
         BranchProductColletion bpc = new BranchProductColletion();
         int param2 = Convert.ToInt32(BranchcomboBox1.SelectedValue);
         if (param2 != 2001)
         {
             bpc.LoadAll2(param2);
             dataGridView1.DataSource = bpc.LoadedTable;
         }
         else
         {
             MessageBox.Show("PLease select Any Branch Inventory");
         }
     }
     else if (LoginForm.USERTYPE == "manager")
     {
         BranchProductColletion bpc1 = new BranchProductColletion();
         int temp1 = Convert.ToInt32(LoginForm.BRCHID);
         bpc1.LoadAll2(temp1);
         dataGridView1.DataSource = bpc1.LoadedTable;
     }
 }