Ejemplo n.º 1
0
        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";
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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";
        }