Exemplo n.º 1
0
        void MenuitemSelectFromUnused_Activated(object sender, EventArgs e)
        {
            equipmentToSetSerial = ytreeEquipment.GetSelectedObject <ReceptionEquipmentItemNode>();
            var nomenclature          = MyOrmDialog.UoW.GetById <Nomenclature>(equipmentToSetSerial.NomenclatureId);
            var selectUnusedEquipment = new OrmReference(EquipmentRepository.GetUnusedEquipment(nomenclature));

            selectUnusedEquipment.Mode            = OrmReferenceMode.Select;
            selectUnusedEquipment.ObjectSelected += SelectUnusedEquipment_ObjectSelected;
            MyTab.TabParent.AddSlaveTab(MyTab, selectUnusedEquipment);
        }
Exemplo n.º 2
0
        private void RegisterSerial()
        {
            var itemNode = ytreeEquipment.GetSelectedObject() as ReceptionEquipmentItemNode;

            if (itemNode.IsNew && itemNode.EquipmentId == 0)
            {
                var dlg = EquipmentGenerator.CreateOne(itemNode.NomenclatureId);
                dlg.EquipmentCreated += OnEquipmentRegistered;
                if (!MyTab.TabParent.CheckClosingSlaveTabs(MyTab))
                {
                    equipmentToSetSerial = itemNode;
                    MyTab.TabParent.AddSlaveTab(MyTab, dlg);
                }
            }
        }
Exemplo n.º 3
0
        void FillListEquipmentFromRoute()
        {
            ReceptionEquipmentList.Clear();
            ReceptionEquipmentItemNode resultAlias = null;

            Vodovoz.Domain.Orders.Order orderAlias = null;
            Equipment      equipmentAlias = null;
            OrderEquipment orderEquipmentAlias = null;
            Nomenclature   equipNomenclatureAlias = null, newEqupNomenclatureAlias = null;
            var            equipmentItems = MyOrmDialog.UoW.Session.QueryOver <RouteListItem>().Where(r => r.RouteList.Id == RouteList.Id)
                                            .JoinAlias(rli => rli.Order, () => orderAlias)
                                            .JoinAlias(() => orderAlias.OrderEquipments, () => orderEquipmentAlias)
                                            .Where(() => orderEquipmentAlias.Direction == Domain.Orders.Direction.PickUp)
                                            .JoinAlias(() => orderEquipmentAlias.Equipment, () => equipmentAlias, NHibernate.SqlCommand.JoinType.LeftOuterJoin)
                                            .JoinAlias(() => equipmentAlias.Nomenclature, () => equipNomenclatureAlias, NHibernate.SqlCommand.JoinType.LeftOuterJoin)
                                            .JoinAlias(() => orderEquipmentAlias.Nomenclature, () => newEqupNomenclatureAlias, NHibernate.SqlCommand.JoinType.LeftOuterJoin)
                                            .SelectList(list => list
                                                        .Select(() => equipmentAlias.Id).WithAlias(() => resultAlias.EquipmentId)
                                                        .Select(Projections.Conditional(
                                                                    Restrictions.Where(() => equipNomenclatureAlias.Id == null),
                                                                    Projections.Property(() => newEqupNomenclatureAlias.Id),
                                                                    Projections.Property(() => equipNomenclatureAlias.Id))).WithAlias(() => resultAlias.NomenclatureId)
                                                        .Select(Projections.Conditional(
                                                                    Restrictions.Where(() => equipNomenclatureAlias.Name == null),
                                                                    Projections.Property(() => newEqupNomenclatureAlias.Name),
                                                                    Projections.Property(() => equipNomenclatureAlias.Name))).WithAlias(() => resultAlias.Name)
                                                        .Select(Projections.Conditional(
                                                                    Restrictions.Where(() => equipNomenclatureAlias.Name == null),
                                                                    Projections.Constant(true),
                                                                    Projections.Constant(false)
                                                                    )).WithAlias(() => resultAlias.IsNew)
                                                        .Select(() => orderEquipmentAlias.ServiceClaim).WithAlias(() => resultAlias.ServiceClaim)
                                                        .Select(() => orderEquipmentAlias.Count).WithAlias(() => resultAlias.NeedReceptionCount)
                                                        )
                                            .TransformUsing(Transformers.AliasToBean <ReceptionEquipmentItemNode>())
                                            .List <ReceptionEquipmentItemNode>();

            foreach (var equipment in equipmentItems)
            {
                ReceptionEquipmentList.Add(equipment);
            }
        }
Exemplo n.º 4
0
        void MenuitemSelectFromClient_Activated(object sender, EventArgs e)
        {
            equipmentToSetSerial = ytreeEquipment.GetSelectedObject <ReceptionEquipmentItemNode>();
            var filter = new ClientBalanceFilter(UoW);

            filter.SetAndRefilterAtOnce(
                x => x.RestrictCounterparty = equipmentToSetSerial.ServiceClaim.Counterparty,
                x => x.RestrictNomenclature = x.UoW.GetById <Nomenclature>(equipmentToSetSerial.NomenclatureId)
                );
            var selectFromClientDlg = new PermissionControlledRepresentationJournal(new Vodovoz.ViewModel.ClientEquipmentBalanceVM(filter));

            selectFromClientDlg.CustomTabName(
                string.Format(
                    "Оборудование у {0}",
                    StringWorks.EllipsizeEnd(equipmentToSetSerial.ServiceClaim.Counterparty.Name, 50)
                    )
                );
            selectFromClientDlg.ObjectSelected += SelectFromClientDlg_ObjectSelected;
            MyTab.TabParent.AddSlaveTab(MyTab, selectFromClientDlg);
        }
 private void RegisterSerial()
 {
     var itemNode = ytreeEquipment.GetSelectedObject () as ReceptionEquipmentItemNode;
     if (itemNode.IsNew && itemNode.EquipmentId==0) {
         var dlg = EquipmentGenerator.CreateOne (itemNode.NomenclatureId);
         dlg.EquipmentCreated += OnEquipmentRegistered;
         if (!MyTab.TabParent.CheckClosingSlaveTabs (MyTab)) {
             equipmentToSetSerial = itemNode;
             MyTab.TabParent.AddSlaveTab (MyTab, dlg);
         }
     }
 }
 void MenuitemSelectFromUnused_Activated(object sender, EventArgs e)
 {
     equipmentToSetSerial = ytreeEquipment.GetSelectedObject<ReceptionEquipmentItemNode>();
     var nomenclature = MyOrmDialog.UoW.GetById<Nomenclature>(equipmentToSetSerial.NomenclatureId);
     var selectUnusedEquipment = new OrmReference(EquipmentRepository.GetUnusedEquipment(nomenclature));
     selectUnusedEquipment.Mode = OrmReferenceMode.Select;
     selectUnusedEquipment.ObjectSelected += SelectUnusedEquipment_ObjectSelected;
     MyTab.TabParent.AddSlaveTab(MyTab, selectUnusedEquipment);
 }
 void MenuitemSelectFromClient_Activated(object sender, EventArgs e)
 {
     equipmentToSetSerial = ytreeEquipment.GetSelectedObject<ReceptionEquipmentItemNode>();
     var filter = new ClientBalanceFilter(UnitOfWorkFactory.CreateWithoutRoot());
     filter.RestrictCounterparty = equipmentToSetSerial.ServiceClaim.Counterparty;
     filter.RestrictNomenclature = filter.UoW.GetById<Nomenclature>(equipmentToSetSerial.NomenclatureId);
     var selectFromClientDlg = new ReferenceRepresentation(new Vodovoz.ViewModel.ClientEquipmentBalanceVM(filter));
     selectFromClientDlg.TabName = String.Format("Оборудование у {0}",
         StringWorks.EllipsizeEnd(equipmentToSetSerial.ServiceClaim.Counterparty.Name, 50));
     selectFromClientDlg.ObjectSelected += SelectFromClientDlg_ObjectSelected;
     MyTab.TabParent.AddSlaveTab(MyTab, selectFromClientDlg);
 }