コード例 #1
0
ファイル: ProductView.cs プロジェクト: klwendel/Capstone-2014
 public ProductView(AccessToken accToken, Product ProductInfo)
 {
     InitializeComponent();
     _myAccessToken = accToken;
     _productManager = new ProductManager();
     _vendorManager = new VendorManager();
     _vendorSourceManager = new VendorSourceItemManager();
     _currentProduct = ProductInfo;
     //Assigning the current product values to the appropriate controls.
     this.Text = "Update Product";
     btMorph.Text = "Update Product";
     tbProductID.Text = ProductInfo.Id.ToString();
     tbDescription.Text = ProductInfo.description;
     tbItemName.Text = ProductInfo.Name;
     nudUnitPrice.Value = ProductInfo.unitPrice;
     nudAvailableQty.Value = ProductInfo.available;
     nudOnHandQty.Value = ProductInfo.reserved;
     nudReorderThreshold.Value = (decimal)ProductInfo._reorderThreshold;
     nudReorderAmount.Value = (decimal)ProductInfo._reorderAmount;
     nudOnOrderAmount.Value = ProductInfo._onOrder;
     txtDimensions.Text = ProductInfo._shippingDemensions;
     nudWeight.Value = (decimal)ProductInfo._shippingWeight;
     PopulateActiveCombo();
     PopulateLocationCombo();
     PopulateListView(lvVendors, ProductInfo.Id);
     this.btnClear.Enabled = false;
     lblPriceDisplay.Text = String.Format("{0:C}", ProductInfo.unitPrice);
     tbItemName.Focus();
     Instance = this;
 }
コード例 #2
0
 public FrmAttachVendorSource(Product product, AccessToken _myAccessToken)
 {
     InitializeComponent();
     _currentProduct = product;
     _vendorSource = new VendorSourceItemManager();
     _vendorManager = new VendorManager();
     _vendors = _vendorManager.GetVendors();
     var RoleAccess = new RoleAccess(_myAccessToken, this);
 }
コード例 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     var vsiManager = new VendorSourceItemManager();
     var vsrcItem = new VendorSourceItem
     {
         ProductID = (int) productCb.SelectedValue,
         VendorID = (int) vendorCb.SelectedValue,
         MinQtyToOrder = (int) minQty.Value,
         UnitCost = Convert.ToDecimal(unitCost.Text),
         Active = true
     };
     vsiManager.AddVendorSourceItem(vsrcItem);
 }
コード例 #4
0
 public FrmAttachVendorSource(Product product, VendorSourceItem currentVendorSourceItem)
 {
     InitializeComponent();
     _vendorSource = new VendorSourceItemManager();
     _vendorManager = new VendorManager();
     _currentVendorSourceItem = currentVendorSourceItem;
     _vendors = _vendorManager.GetVendors();
     _currentProduct = product;
     nudCase.Value = _currentVendorSourceItem.ItemsPerCase;
     nudMinnimum.Value = _currentVendorSourceItem.MinQtyToOrder;
     nudUnitPrice.Value = _currentVendorSourceItem.UnitCost;
     btnAdd.Text = "Update Vendor";
     comboVendors.Enabled = false;
 }
コード例 #5
0
ファイル: ProductView.cs プロジェクト: klwendel/Capstone-2014
 public ProductView(AccessToken accToken)
 {
     InitializeComponent();
     var RoleAccess = new RoleAccess(accToken, this);
     _myAccessToken = accToken;
     _productManager = new ProductManager();
     _vendorManager = new VendorManager();
     _vendorSourceManager = new VendorSourceItemManager();
     this.Text = "Add Product";
     btMorph.Text = "Add Product";
     PopulateLocationCombo();
     PopulateActiveCombo();
     tbProductID.Enabled = false;
     tbProductID.Text = "The ID will automatically be created.";
     this.lblVendors.Visible = false;
     this.lvVendors.Visible = false;
     this.btAddVendor.Visible = false;
     lblPriceDisplay.Text = String.Format("{0:C}", 0);
     lblWeightDisplay.Text = "0.0 lbs";
     tbProductID.Focus();
     Instance = this;
 }
コード例 #6
0
        private void fillProductDropDown(Int32 vendorID)
        {
            cbProductName.Items.Clear();
            List<VendorSourceItem> vendorSourceItemList = new List<VendorSourceItem>();
            VendorSourceItemManager _vendorSourceItemManager = new VendorSourceItemManager();
            vendorSourceItemList = _vendorSourceItemManager.GetVendorSourceItemsByVendor(vendorID);
            ProductManager _productManager = new ProductManager();

            foreach (VendorSourceItem v in vendorSourceItemList)
            {
                cbProductName.Items.Add(v.ProductID + " " + _productManager.GetProduct(v.ProductID).Name);
            }
        }
コード例 #7
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += "                         " + _myAccessToken.FirstName + " " + _myAccessToken.LastName + " logged in as a " + _myAccessToken.Role.Name;

             var vsiManager = new VendorSourceItemManager();
             fillListView(vnd,vsiManager.GetAllVendorSourceItems());
             var venManager = new VendorManager();
             fillVendorDropDown(vendorCb, venManager.GetVendors());

             var prodManager = new ProductManager();
             fillProductDropDown(productCb, prodManager.GetProducts());
        }