コード例 #1
0
        public App_Item GetItem(string itemCode, string warehouseCode, string manufacturerSerialNumber)
        {
            App_Item appItem = null;
            CI_Item item = null;
            IM_ItemWarehouse itemWarehouse = null;
            JT_EquipmentAsset equipmentAsset = null;

            lock (_locker)
            {
                item = GetItemFromDB(itemCode);
                itemWarehouse = GetItemWarehouseFromDB(itemCode, warehouseCode);                

                if ((item != null) && (itemWarehouse != null))
                {
                    if (manufacturerSerialNumber != null)
                    {
                        equipmentAsset = GetEquipmentAsset(item.ItemCode, manufacturerSerialNumber);
                    }

                    appItem = new App_Item(item, itemWarehouse, equipmentAsset);
                }
            }

            return appItem;
        }
コード例 #2
0
 private void ButtonSearch_Click(object sender, RoutedEventArgs e)
 {
     if (searchBarText.Text == null || searchBarText.Text.Length == 0)
     {
         _vm.FilterItemList(null);
     }
     else
     {
         // dch rkl 11/15/2016 add miscellaneous part
         if (searchBarText.Text.Trim().Substring(0, 1) == "*")
         {
             CI_Item ciItem = new CI_Item();
             ciItem.ItemCode              = searchBarText.Text.Trim();
             ciItem.ItemCodeDesc          = "";
             ciItem.StandardUnitOfMeasure = "EACH";
             IM_ItemWarehouse  imWhse      = new IM_ItemWarehouse();
             JT_EquipmentAsset jtAsst      = new JT_EquipmentAsset();
             App_Item          appItem     = new App_Item(ciItem, imWhse, jtAsst);
             App_RepairPart    part        = new App_RepairPart(appItem, _vm.WorkTicket);
             ContentControl    contentArea = (ContentControl)this.Parent;
             contentArea.Content = new PartsEditPage(_vm.WorkTicket, part, PartsEditPage.PageMode.Add, _scheduledAppointment);
         }
         else
         {
             _vm.FilterItemList(searchBarText.Text);
         }
     }
 }