Exemplo n.º 1
0
        protected void OnButtonAddEnumItemClicked(object sender, QS.Widgets.EnumItemClickedEventArgs e)
        {
            ProxyDocumentType type = (ProxyDocumentType)e.ItemEnum;
            var dlg = OrmMain.CreateObjectDialog(ProxyDocument.GetProxyDocumentClass(type));

            dlg.EntitySaved += Dlg_EntitySaved;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 2
0
 protected void OnButtonEditClicked(object sender, EventArgs e)
 {
     if (tableDocuments.GetSelectedObjects().GetLength(0) > 0)
     {
         int id = (tableDocuments.GetSelectedObjects()[0] as ProxyDocumentsVMNode).Id;
         ProxyDocumentType type = (tableDocuments.GetSelectedObjects()[0] as ProxyDocumentsVMNode).Type;
         var dlg = OrmMain.CreateObjectDialog(ProxyDocument.GetProxyDocumentClass(type), id);
         dlg.EntitySaved += Dlg_EntitySaved;
         TabParent.AddSlaveTab(this, dlg);
     }
 }
Exemplo n.º 3
0
        public void OpenEntityDlg(int id)
        {
            if (OrmMain.GetObjectDescription(typeof(TEntity)).SimpleDialog)
            {
                EntityEditSimpleDialog.RunSimpleDialog((GetMyTab().TabParent as Widget).Toplevel as Window, typeof(TEntity), id);
                return;
            }

            ITdiTab dlg = OrmMain.CreateObjectDialog(typeof(TEntity), id);

            GetMyTab().TabParent.AddTab(dlg, GetMyTab());
        }
Exemplo n.º 4
0
        protected void OnButtonAddEnumItemClicked(object sender, QS.Widgets.EnumItemClickedEventArgs e)
        {
            DocumentType type = (DocumentType)e.ItemEnum;

            switch (type)
            {
            case DocumentType.MovementDocument:
                TabParent.OpenTab(
                    DialogHelper.GenerateDialogHashName(Document.GetDocClass(type), 0),
                    () => {
                    return(new MovementDocumentViewModel(
                               EntityUoWBuilder.ForCreate(),
                               UnitOfWorkFactory.GetDefaultFactory,
                               new WarehousePermissionService(),
                               VodovozGtkServicesConfig.EmployeeService,
                               new EntityExtendedPermissionValidator(PermissionExtensionSingletonStore.GetInstance(), EmployeeSingletonRepository.GetInstance()),
                               new NomenclatureSelectorFactory(),
                               new OrderSelectorFactory(),
                               new WarehouseRepository(),
                               UserSingletonRepository.GetInstance(),
                               new RdlPreviewOpener(),
                               ServicesConfig.CommonServices
                               ));
                },
                    this
                    );
                break;

            case DocumentType.IncomingInvoice:
                TabParent.OpenTab(
                    DialogHelper.GenerateDialogHashName(Document.GetDocClass(type), 0),
                    () => {
                    return(new IncomingInvoiceViewModel(
                               EntityUoWBuilder.ForCreate(),
                               UnitOfWorkFactory.GetDefaultFactory,
                               new WarehousePermissionService(),
                               VodovozGtkServicesConfig.EmployeeService,
                               new EntityExtendedPermissionValidator(PermissionExtensionSingletonStore.GetInstance(), EmployeeSingletonRepository.GetInstance()),
                               new NomenclatureSelectorFactory(),
                               new OrderSelectorFactory(),
                               new WarehouseRepository(),
                               new RdlPreviewOpener(),
                               ServicesConfig.CommonServices
                               ));
                },
                    this
                    );
                break;

            case DocumentType.IncomingWater:
            case DocumentType.WriteoffDocument:
            case DocumentType.SelfDeliveryDocument:
            case DocumentType.CarLoadDocument:
            case DocumentType.CarUnloadDocument:
            case DocumentType.InventoryDocument:
            case DocumentType.ShiftChangeDocument:
            case DocumentType.RegradingOfGoodsDocument:
            default:
                TabParent.OpenTab(
                    DialogHelper.GenerateDialogHashName(Document.GetDocClass(type), 0),
                    () => OrmMain.CreateObjectDialog(Document.GetDocClass(type)),
                    this
                    );
                break;
            }
        }
Exemplo n.º 5
0
 public ITdiDialog CreateDialog(params object[] parameters)
 {
     return(OrmMain.CreateObjectDialog(EntityClass, parameters));
 }