private void loadAllItemsToView()
        {
            try {
                addStockTransfer.grid_itemFinder.IsEnabled     = false;
                addStockTransfer.button_saveTransfer.IsEnabled = false;
                addStockTransfer.button_addItem.IsEnabled      = false;
                addStockTransfer.dataGrid.IsEnabled            = false;
                StockTransfer stockTransfer = getStockTransferById(addStockTransfer.SelectedStockTransferID);
                if (stockTransfer != null)
                {
                    addStockTransfer.comboBox_from_selectStock.SelectedValue  = stockTransfer.FromLocationId;
                    addStockTransfer.comboBox_to_selectStock.SelectedValue    = stockTransfer.ToLocationId;
                    addStockTransfer.datePicker_date_selectStock.SelectedDate = stockTransfer.Date;
                    addStockTransfer.textBox_carrierName_selectStock.Text     = stockTransfer.Carrier;
                    addStockTransfer.textBox_details_selectStock.Text         = stockTransfer.Details;

                    StockTransferItem sti = new StockTransferItem();
                    sti.StockTransferId = stockTransfer.Id;
                    List <StockTransferItem> list = getTransferItem(sti);
                    foreach (StockTransferItem stockTransferItem in list)
                    {
                        Item item = itemManagerImpl.getItemById(stockTransferItem.ItemId);
                        addStockTransfer.DataTable.Rows.Add(stockTransferItem.Id, item.Name + " (" + companyManagerImpl.getCompanyNameById(item.CompanyId) + ")", stockTransferItem.Quantity);
                    }
                }
            } catch (Exception) {
            }
        }
Exemplo n.º 2
0
 internal void loadPricesForItemId()
 {
     try {
         sellingPriceManager.DataTableUnitPrice.Rows.Clear();
         sellingPriceManager.DataTablePackPrice.Rows.Clear();
         Item item = itemManagerImpl.getItemById(sellingPriceManager.textBox_selectedItemId.IntValue);
         sellingPriceManager.SelectedItemId             = item.Id;
         sellingPriceManager.label_selectedItem.Content = companyManagerImpl.getCompanyNameById(item.CompanyId) + ", " + item.Name + " " + categoryManagerImpl.getCategoryNameById(item.CategoryId);
         List <SellingPrice> list    = getSellingPriceByItemId(sellingPriceManager.textBox_selectedItemId.IntValue);
         DataRow             dataRow = null;
         foreach (SellingPrice sellingPrice in list)
         {
             if (sellingPrice.Mode == "u")
             {
                 dataRow = sellingPriceManager.DataTableUnitPrice.NewRow();
                 sellingPriceManager.DataTableUnitPrice.Rows.Add(dataRow);
             }
             else
             {
                 dataRow = sellingPriceManager.DataTablePackPrice.NewRow();
                 sellingPriceManager.DataTablePackPrice.Rows.Add(dataRow);
             }
             dataRow[0] = sellingPrice.Id;
             dataRow[1] = sellingPrice.Price.ToString("#,##0.00");
         }
     } catch (Exception) {
     }
 }
Exemplo n.º 3
0
        internal void filter()
        {
            try {
                itemManager.DataTable.Rows.Clear();
                Item i = getItemForFilter();
                i.LimitStart = itemManager.Pagination.LimitStart;
                i.LimitEnd   = itemManager.Pagination.LimitCount;
                List <Item> list = get(i);
                DataRow     row  = null;
                foreach (Item item in list)
                {
                    row     = itemManager.DataTable.NewRow();
                    row[0]  = item.Id;
                    row[1]  = categoryManagerImpl.getCategoryNameById(item.CategoryId);
                    row[2]  = companyManagerImpl.getCompanyNameById(item.CompanyId);
                    row[3]  = item.Name;
                    row[4]  = unitManagerImpl.getUnitNameById(item.UnitId);
                    row[5]  = item.Code;
                    row[6]  = item.Barcode;
                    row[7]  = item.PosName;
                    row[8]  = item.QuantityPerPack;
                    row[9]  = item.PackName;
                    row[10] = item.ReorderLevel;

                    itemManager.DataTable.Rows.Add(row);
                }
            } catch (Exception) {
            }
        }
Exemplo n.º 4
0
 internal void loadDiscountsForItemId()
 {
     try {
         discountManager.DataTableUnitDiscount.Rows.Clear();
         discountManager.DataTablePackDiscount.Rows.Clear();
         Item item = itemManagerImpl.getItemById(discountManager.textBox_selectedItemId.IntValue);
         discountManager.label_selectedItem.Content = companyManagerImpl.getCompanyNameById(item.CompanyId) + ", " + item.Name + " " + categoryManagerImpl.getCategoryNameById(item.CategoryId);
         List <Discount> list    = getDiscountsByItemId(discountManager.textBox_selectedItemId.IntValue);
         DataRow         dataRow = null;
         foreach (Discount discount in list)
         {
             if (discount.Mode == "u")
             {
                 dataRow = discountManager.DataTableUnitDiscount.NewRow();
                 discountManager.DataTableUnitDiscount.Rows.Add(dataRow);
             }
             else
             {
                 dataRow = discountManager.DataTablePackDiscount.NewRow();
                 discountManager.DataTablePackDiscount.Rows.Add(dataRow);
             }
             dataRow[0] = discount.Id;
             dataRow[1] = discount.Quantity.ToString("#,##0.00");
             dataRow[2] = discount.Value.ToString();
         }
         if (item.Sip == 0)
         {
             discountManager.groupBox_packDiscounts.IsEnabled = false;
         }
         else
         {
             discountManager.groupBox_packDiscounts.IsEnabled = true;
         }
     } catch (Exception) {
     }
 }