void DlgManualSet_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var dlg = sender as ReferenceRepresentation; var editingRow = dlg.Tag as ReadingXLSRow; editingRow.Fitting = UoW.GetById <Fitting>(e.ObjectId); editingRow.Status = ReadingXLSRow.RowStatus.ManualSet; }
void Dlg_ObjectSelected1(object sender, ReferenceRepresentationSelectedEventArgs e) { var fittings = UoW.GetById <Fitting> (e.GetNodes <FittingVMNode> ().Select(x => x.Id).ToArray()); foreach (var item in e.GetNodes <FittingVMNode>()) { Entity.AddItem(fittings.First(x => x.Id == item.Id)); } }
void Dlg_ItemPriceSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var dlg = sender as ReferenceRepresentation; var priceEditingItem = dlg.Tag as ProjectItem; var priceItem = UoW.GetById <PriceItem>(e.ObjectId); priceEditingItem.FittingPrice = priceItem.Cost; priceEditingItem.PriceCurrency = priceItem.Currency; priceEditingItem.SelectedPriceItem = priceItem; }
void AddEmployeeDlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var employee = UoW.GetById <Employee>(e.ObjectId); if (Entity.Items.Any(x => x.Employee.Id == employee.Id)) { MessageDialogWorks.RunErrorDialog("Сотрудник {0} уже присутствует в списке.", employee.ShortName); return; } Entity.AddItem(employee); }
void ChangeOldNomenclature_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var row = ytreeviewItems.GetSelectedObject <RegradingOfGoodsDocumentItem>(); if (row == null) { return; } var nomenclature = DocumentUoW.GetById <Nomenclature>(e.ObjectId); var VMNode = e.VMNode as ViewModel.StockBalanceVMNode; row.NomenclatureOld = nomenclature; row.AmountInStock = VMNode.Amount; }
void SelectOldNomenclature_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var nomenclature = DocumentUoW.GetById <Nomenclature>(e.ObjectId); var VMNode = e.VMNode as ViewModel.StockBalanceVMNode; newRow = new RegradingOfGoodsDocumentItem() { NomenclatureOld = nomenclature, AmountInStock = VMNode.Amount }; var selectNewNomenclature = new OrmReference(QueryOver.Of <Nomenclature>().Where(n => n.Category.IsIn(Nomenclature.GetCategoriesForGoods()))); selectNewNomenclature.Mode = OrmReferenceMode.Select; selectNewNomenclature.TabName = "Выберите новую номенклатуру"; selectNewNomenclature.ObjectSelected += SelectNewNomenclature_ObjectSelected; MyTab.TabParent.AddSlaveTab(MyTab, selectNewNomenclature); }
void Dlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var fittings = UoW.GetById <Fitting> (e.GetNodes <FittingVMNode> ().Select(x => x.Id).ToArray()); PriceСurrency defaulCurr = PriceСurrency.USD; if (Entity.Prices.Count > 0) { defaulCurr = Entity.Prices.GroupBy(x => x.Currency) .Select(g => new { Currency = g.Key, Count = g.Count(), }).OrderByDescending(x => x.Count).First().Currency; } foreach (var item in e.GetNodes <FittingVMNode>()) { Entity.AddItem(fittings.First(x => x.Id == item.Id), defaulCurr); } }
void NomenclatureSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var nomenctature = DocumentUoW.GetById <Nomenclature> (e.ObjectId); DocumentUoW.Root.AddItem(nomenctature, 0, (e.VMNode as ViewModel.StockBalanceVMNode).Amount); }
void Dlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var points = UoW.GetById <DeliveryPoint>(e.GetSelectedIds()).ToList(); points.ForEach(Entity.AddDeliveryPoint); }
void NomenclatureSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var nomenctature = DocumentUoW.GetById<Nomenclature> (e.ObjectId); DocumentUoW.Root.AddItem(nomenctature, 0, (e.VMNode as ViewModel.StockBalanceVMNode).Amount); }
void Dlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var point = ContractUoW.GetById <DeliveryPoint>(e.ObjectId); ContractUoW.Root.AddAddress(point); }
void EquipmentByTypeSelected(object sender, ReferenceRepresentationSelectedEventArgs args) { var equipmentType = AgreementUoW.GetById<EquipmentType>(args.ObjectId); var rentPackage = Repository.RentPackageRepository.GetFreeRentPackage(AgreementUoW, equipmentType); if (rentPackage == null) { MessageDialogWorks.RunErrorDialog("Для выбранного типа оборудования нет пакета бесплатной аренды."); return; } var exclude = equipments.Select(e => e.Equipment.Id).ToArray(); var selectedEquipment = EquipmentRepository.GetAvailableEquipmentForRent(AgreementUoW, equipmentType, exclude); if(selectedEquipment == null) { MessageDialogWorks.RunErrorDialog("Не найдено свободного оборудования выбранного типа."); return; } FreeRentEquipment eq = new FreeRentEquipment (); eq.Equipment = selectedEquipment; eq.Deposit = rentPackage.Deposit; eq.FreeRentPackage = rentPackage; eq.WaterAmount = rentPackage.MinWaterAmount; equipments.Add (eq); UpdateTotalLabels (); }
void SelectFromObjectDlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { foreach(var node in e.GetNodes<ViewModel.ObjectBalanceVMNode> ()) { IncomeDoc.AddItem (MyOrmDialog.UoW.GetById<ExpenseItem> (node.Id), node.Added - node.Removed); } CalculateTotal(); }
void Dlg_EditObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { editingItem.Fitting = UoW.GetById <Fitting> (e.ObjectId); }
void SelectDlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { foreach(var node in e.GetNodes<ViewModel.StockBalanceVMNode> ()) { ExpenceDoc.AddItem (MyOrmDialog.UoW.GetById<IncomeItem> (node.Id)); } CalculateTotal(); }
void Dlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var contacts = UoW.GetById <Contact>(e.GetSelectedIds()).ToList(); contacts.ForEach(Entity.AddContact); }
void SelectFromClientDlg_ObjectSelected(object sender, ReferenceRepresentationSelectedEventArgs e) { var equipment = MyOrmDialog.UoW.GetById<Equipment>(e.ObjectId); equipmentToSetSerial.NewEquipment = equipment; equipmentToSetSerial.EquipmentId = equipment.Id; equipmentToSetSerial.Returned = true; //OnEquipmentListChanged(); }