private void SetSelectedToFields(TblItemDim itemDimFrom, ItemDimensionFPSearchViewModel itemTo) { itemTo.ItemDimToIserial = itemDimFrom.Iserial; itemTo.ColorToId = itemDimFrom.TblColor; itemTo.SizeTo = itemDimFrom.Size; itemTo.BatchNoTo = itemDimFrom.BatchNo; itemTo.SiteToIserial = itemDimFrom.TblSite; }
private void SetSelectedFromFields(TblItemDim itemDimFrom, ItemDimensionFPSearchViewModel itemTo) { itemTo.ItemDimFromIserial = itemDimFrom.Iserial; itemTo.ColorFromId = itemDimFrom.TblColor; itemTo.SizeFrom = itemDimFrom.Size; itemTo.BatchNoFrom = itemDimFrom.BatchNo; itemTo.SiteFromIserial = itemDimFrom.TblSite; }
public ItemFPSearchViewModel() { Client.AccWithConfigAndSizeCompleted += (s, sv) => { bool isSearchItem = false; var itemSearchModel = SearchResultList.FirstOrDefault(i => i.ItemId == sv.Result.Iserial && i.ItemType == sv.Result.ItemGroup); CRUDManagerService.ItemsDto item; if (itemSearchModel != null) { item = itemSearchModel.ItemPerRow ?? (itemSearchModel.ItemPerRow = new CRUDManagerService.ItemsDto()); isSearchItem = true; } else { item = ItemPerRow; } item.AccConfigList = sv.Result.AccConfigList; item.SizesList = new ObservableCollection <string>(); item.CombinationList = sv.Result.CombinationList; var tblAccessoryAttributesDetails = sv.Result.CombinationList.FirstOrDefault(); if (tblAccessoryAttributesDetails != null) { item.SizesList.Add(tblAccessoryAttributesDetails.Size); } if (item.CombinationList != null) { item.SizesList = new ObservableCollection <string>(); } if (isSearchItem) { if (item.AccConfigList == null) { item.AccConfigList = new ObservableCollection <CRUDManagerService.TblColor>(); } itemSearchModel.ColorPerRow = item.AccConfigList.FirstOrDefault(c => c.Iserial == itemSearchModel.ColorToId); } }; CancelCommand = new RelayCommand((o) => // هقفل وارجع فولس يعرف انه كنسل { var view = (o as ChildWindowsOverride); if (view != null) { view.DialogResult = false; view.Close(); } }); ApplyCommand = new RelayCommand((o) => { var view = (o as ItemFPSearchChildWindow); if (view != null) { //هنا هاخد الى مختاره فى الجريد للشاشة الاصلية ApplySelectedItem(view); } }); OkCommand = new RelayCommand((o) => { var view = (o as ItemFPSearchChildWindow); if (view != null) { //هنا هاخد الى مختاره فى الجريد للشاشة الاصلية لو مكانش راح //وهقفل الشاشة فى الاخر try { var item = view.DataContext as ItemFPSearchViewModel; ItemDimensionFPSearchViewModel newSearchData = new ItemDimensionFPSearchViewModel(); newSearchData.ItemPerRow = item.ItemPerRow; newSearchData.ColorPerRow = item.ColorPerRow; item.FPAppliedSearchResultList.Add(newSearchData); view.DialogResult = true; view.Close(); } catch { } } }); LoadingRow = new GalaSoft.MvvmLight.Command.RelayCommand <object>((o) => { //var e = o as System.Windows.Controls.DataGridRowEventArgs; //if (SearchResultList.Count < PageSize) //{ // return; //} //if (SearchResultList.Count - 2 < e.Row.GetIndex() && !Loading) //{ // GetInspectionWarehouseRows(); //} }); }