Esempio n. 1
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) {
            }
        }
Esempio 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) {
     }
 }
Esempio n. 3
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) {
     }
 }