Esempio n. 1
0
 private void UpdateView(DetailView detailView) {
     var viewEditMode = ((IModelDetailViewViewEditMode)detailView.Model).ViewEditMode;
     if (viewEditMode.HasValue) {
         if (!detailView.ObjectSpace.IsNewObject(detailView.CurrentObject)) {
             UpdateViewEditModeState(detailView, viewEditMode.Value);
             UpdateViewAllowEditState(detailView);
         }
     }
 }
Esempio n. 2
0
 public void Proccess(CustomProcessShortcutEventArgs shortcutEventArgs) {
     if (shortcutEventArgs.Handled) return;
     var shortcut = shortcutEventArgs.Shortcut;
     IModelDetailView modelDetailView = GetModelDetailView(shortcut);
     if ((modelDetailView != null && IsEnable(modelDetailView))) {
         if (CanCreate(modelDetailView.ModelClass.TypeInfo)) {
             shortcutEventArgs.Handled = true;
             var objectSpace = _application.CreateObjectSpace();
             object obj = GetObject(shortcut, modelDetailView, objectSpace);
             _detailView = _application.CreateDetailView(objectSpace, modelDetailView, true, obj);
             shortcutEventArgs.View = _detailView;
         }
     }
 }
Esempio n. 3
0
        void ShowViewVariantView(SingleChoiceActionExecuteEventArgs singleChoiceActionExecuteEventArgs, Action <DialogController> dialogControllerAction, Action <DetailView> detailViewAction)
        {
            var        objectSpace = Application.CreateObjectSpace(typeof(ViewVariant));
            DetailView detailView  = Application.CreateDetailView(objectSpace, objectSpace.CreateObject <ViewVariant>());

            detailView.ViewEditMode = ViewEditMode.Edit;
            singleChoiceActionExecuteEventArgs.ShowViewParameters.CreatedView  = detailView;
            singleChoiceActionExecuteEventArgs.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
            detailViewAction.Invoke(detailView);
            var dialogController = new DialogController();

            dialogController.Accepting += (o, args) => {
                var controller = ((DialogController)o);
                Validator.RuleSet.Validate(controller.Frame.View.ObjectSpace, controller.Frame.View.CurrentObject, ContextIdentifier.Save);
                dialogControllerAction.Invoke(controller);
            };
            singleChoiceActionExecuteEventArgs.ShowViewParameters.Controllers.Add(dialogController);
        }
Esempio n. 4
0
        private void WystawKorekteAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            IObjectSpace os             = Application.CreateObjectSpace();
            var          factory        = new InvoiceFactory(os);
            var          wybranaFaktura = os.GetObject(View.CurrentObject as Faktura);
            var          korekta        = factory.UtworzKorekteCalkowita(wybranaFaktura);

            if (korekta != null)
            {
                string     detailId   = Application.FindDetailViewId(korekta.GetType());
                DetailView detailView = Application.CreateDetailView(os, detailId, true, korekta);
                e.ShowViewParameters.CreatedView  = detailView;
                e.ShowViewParameters.Context      = TemplateContext.View;
                e.ShowViewParameters.TargetWindow = TargetWindow.Default;
                // po zamknieciu okna zostanie wywołane zdarzenie
                detailView.Closed += DetailView_Closed;
            }
        }
        public ActionResult SetScale(string Scale, string parkCode)
        {
            Session["Scale"] = Scale;
            //var parks = _dal.GetAllParks();
            DetailView detailView = new DetailView();

            detailView.park    = _dal.ParkByCode(parkCode);
            detailView.weather = _dal.GetPark5DayForecast(parkCode);
            if (Scale == "true")
            {
                foreach (var item in detailView.weather)
                {
                    item.HighTemp = ((item.HighTemp - 32) * 5 / 9);
                    item.LowTemp  = ((item.LowTemp - 32) * 5 / 9);
                }
            }
            return(View("WeatherDetail", detailView));
        }
Esempio n. 6
0
        private void showNavigationItemController_CustomShowNavigationItem(object sender, CustomShowNavigationItemEventArgs e)
        {
            ViewShortcut viewShortcut = e.ActionArguments.SelectedChoiceActionItem.Data as ViewShortcut;
            string       listViewId   = Application.FindListViewId(typeof(NavigationObject));

            if (viewShortcut != null)
            {
                if (viewShortcut.ViewId == listViewId)
                {
                    IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(NavigationObject));
                    DetailView   detailView  = Application.CreateDetailView(objectSpace, objectSpace.FindObject(typeof(NavigationObject), null));
                    detailView.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit;
                    e.ActionArguments.ShowViewParameters.CreatedView  = detailView;
                    e.ActionArguments.ShowViewParameters.TargetWindow = TargetWindow.Current;
                    e.Handled = true;
                }
            }
        }
Esempio n. 7
0
        void Control_Validated(object sender, EventArgs e)
        {
            DetailView dv = View as DetailView;

            if (dv != null)
            {
                StringPropertyEditor prd = dv.FindItem("PrdctCptr") as StringPropertyEditor;

                if (prd != null && !string.IsNullOrEmpty(prd.ControlValue.ToString()))
                {
                    prd.Refresh();
                    if (string.IsNullOrEmpty(prd.ControlValue.ToString()))
                    {
                        prd.Control.Focus();
                    }
                }
            }
        }
Esempio n. 8
0
 void showNavigationItemController_CustomShowNavigationItem(object sender, CustomShowNavigationItemEventArgs e)
 {
     try
     {
         if (e.ActionArguments.SelectedChoiceActionItem.Id == "About")
         {
             IObjectSpace objectSpace = Application.CreateObjectSpace();
             About        obj         = objectSpace.FindObject <About>(new BinaryOperator("Code", "About"));
             DetailView   detailView  = Application.CreateDetailView(objectSpace, obj);
             detailView.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.View;
             e.ActionArguments.ShowViewParameters.CreatedView = detailView;
             e.Handled = true;
         }
     }
     catch (Exception)
     {
     }
 }
Esempio n. 9
0
        private static Unit SynchronizeCurrentObject(this DetailView detailView, object o, ListView listView, DashboardViewItem dashboardViewItem, NestedFrame frame)
        {
            var objectTypeLink = detailView.GetObjectTypeLink(o, listView);

            if (objectTypeLink != null)
            {
                detailView = objectTypeLink.CreateDetailView(detailView, dashboardViewItem, frame);
            }

            if (detailView.ObjectSpace == null)
            {
                dashboardViewItem.Frame.SetView(null);
                detailView = (DetailView)frame.Application.NewView(detailView.Model);
                dashboardViewItem.Frame.SetView(detailView);
            }
            detailView.CurrentObject = detailView.ObjectSpace.GetObject(o);
            return(Unit.Default);
        }
Esempio n. 10
0
        private async Task FromFolderToDeleted(string inputFileSubPath,
                                               string toFileSubPath, List <FileIndexItem> fileIndexResultsList,
                                               DetailView detailView)
        {
            // clean from cache
            _query.RemoveCacheParentItem(inputFileSubPath);

            var fileIndexItems = await _query.GetAllRecursiveAsync(inputFileSubPath);

            // Rename child items
            fileIndexItems.ForEach(p =>
            {
                var parentDirectory = p.ParentDirectory
                                      .Replace(inputFileSubPath, toFileSubPath);
                p.ParentDirectory = parentDirectory;
                p.Status          = FileIndexItem.ExifStatus.Ok;
                p.Tags            = p.Tags.Replace("!delete!", string.Empty);
            }
                                   );

            // when there is already a database item in the output folder, but not on disk
            // in the final step we going to update the database item to the new name
            var toCheckList = fileIndexItems.Select(p => p.FilePath).ToList();

            toCheckList.Add(toFileSubPath);
            var checkOutput = await _query.GetObjectsByFilePathQueryAsync(toCheckList);

            foreach (var item in checkOutput)
            {
                await _query.RemoveItemAsync(item);
            }

            // save before changing on disk
            await SaveToDatabaseAsync(fileIndexItems, fileIndexResultsList,
                                      detailView, toFileSubPath);

            // move entire folder
            _iStorage.FolderMove(inputFileSubPath, toFileSubPath);

            fileIndexResultsList.Add(new FileIndexItem(inputFileSubPath)
            {
                Status = FileIndexItem.ExifStatus.NotFoundSourceMissing
            });
        }
Esempio n. 11
0
        private void GotoEmp_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            SystemUsers  selectebobject = (SystemUsers)View.CurrentObject;
            IObjectSpace os             = Application.CreateObjectSpace();

            Employees targetobject = os.FindObject <Employees>(new BinaryOperator("SystemUser.Oid", selectebobject.Oid, BinaryOperatorType.Equal));

            if (targetobject is null)
            {
                targetobject            = os.CreateObject <Employees>();
                targetobject.SystemUser = os.GetObjectByKey <SystemUsers>(selectebobject.Oid);
            }
            DetailView dv = Application.CreateDetailView(os, targetobject, true);

            dv.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit;
            ((Employees)dv.CurrentObject).IsSystemUserCalling = true;

            e.View = dv;
        }
Esempio n. 12
0
        public void SetUp()
        {
            XPObjectSpaceProvider objectSpaceProvider =
                new XPObjectSpaceProvider(new MemoryDataStoreProvider());
            TestApplication application = new TestApplication();
            ModuleBase      testModule  = new ModuleBase();

            testModule.AdditionalExportedTypes.Add(typeof(MyPerson));
            application.Modules.Add(testModule);
            application.Modules.Add(new ConditionalAppearanceModule());
            application.Setup("TestApplication", objectSpaceProvider);
            IObjectSpace objectSpace = objectSpaceProvider.CreateObjectSpace();

            person     = objectSpace.CreateObject <MyPerson>();
            target     = new FakeAppearanceTarget();
            controller = new AppearanceController();
            detailView = application.CreateDetailView(objectSpace, person);
            controller.SetView(detailView);
        }
        /// <summary>
        /// Создать и открыть объект fmCPRRepaymentTask в модальном окне
        /// </summary>
        private void ManualBinding_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            fmCSAStatementAccountDoc current = e.CurrentObject as fmCSAStatementAccountDoc;

            if (current == null)
            {
                return;
            }

            //fmCPRRepaymentTask RT = ObjectSpace.CreateObject<fmCPRRepaymentTask>();
            //IObjectSpace objectSpace = ObjectSpace.CreateNestedObjectSpace();   // Frame.Application.CreateObjectSpace();
            IObjectSpace objectSpace = Application.CreateObjectSpace();

            // Create object
            //fmCPRRepaymentTask nestedRT = objectSpace.GetObject<fmCPRRepaymentTask>(RT);
            fmCPRRepaymentTask nestedRT = objectSpace.CreateObject <fmCPRRepaymentTask>();

            if (current.StatementAccountIn != null)
            {
                nestedRT.BankAccount = objectSpace.GetObject <crmBankAccount>(current.StatementAccountIn.BankAccount);
            }
            else if (current.StatementAccountOut.BankAccount != null)
            {
                nestedRT.BankAccount = objectSpace.GetObject <crmBankAccount>(current.StatementAccountOut.BankAccount);
            }
            nestedRT.PaymentDocument = objectSpace.GetObject <fmCDocRCB>(current.PaymentDocument);
            nestedRT.FillRepaymentTaskLines();
            nestedRT.FillRequestList();

            // Show object
            string DetailViewId = Frame.Application.FindDetailViewId(nestedRT.GetType());

            //BaseObject passedObj = nestedRT;   // objectSpace.GetObject<BaseObject>(rt);

            TargetWindow       openMode = TargetWindow.NewModalWindow;
            DetailView         dv       = Frame.Application.CreateDetailView(objectSpace, DetailViewId, true, nestedRT);
            ShowViewParameters svp      = new ShowViewParameters()
            {
                CreatedView = dv, TargetWindow = openMode, Context = TemplateContext.View, CreateAllControllers = true
            };

            e.ShowViewParameters.Assign(svp);
        }
Esempio n. 14
0
        private void EditInventoryItemBatchPopup_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            TargetViewId = "ItemInventoryBatch_DetailView";
            {
                IObjectSpace newObjectSpace = Application.CreateObjectSpace(View.ObjectTypeInfo.Type);
                objectToShow = (ItemInventoryBatch)newObjectSpace.GetObject(View.CurrentObject);

                if (objectToShow != null)
                {
                    createdView = Application.CreateDetailView(newObjectSpace, objectToShow);
                    createdView.ViewEditMode = ViewEditMode.Edit;

                    e.View = createdView;


                    objectToShow.LastScanChangedEvent += ObjectToShow_LastScanChangedEvent;
                }
            }
        }
Esempio n. 15
0
        public ActionResult UserDetails(DetailView detailView, string btn)
        {
            UserData userData = new UserData();

            int userResult = userData.UpdateDetailview(detailView);

            if (userResult == 0)
            {
                SessionHelper.ErrorMessage = "UPDATE_SUCCESS";
                logonUserSession.FIRSTNAME = detailView.Firstname;
                logonUserSession.LASTNAME  = detailView.Lastname;
                return(RedirectToAction("UserDetails", new { value = "success" }));
            }
            else if (userResult == -1)
            {
                SessionHelper.ErrorMessage = "UPDATE_FAIL";
            }
            return(RedirectToAction("UserDetails"));
        }
Esempio n. 16
0
        private void doSetActionDone_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            DetailView         curView   = (DetailView)View;
            actionActionAnlage curAction = (actionActionAnlage)curView.CurrentObject;

            curAction.Status = EnumStore.enmBearbeitungsStatus.erledigt;
            if (curAction.lstActionPosition != null)
            {
                for (int i = 0; i < curAction.lstActionPosition.Count; i++)
                {
                    ((actionActionPosition)curAction.lstActionPosition[i]).Status = EnumStore.enmBearbeitungsStatus.erledigt;
                    ((actionActionPosition)curAction.lstActionPosition[i]).Save();
                }
            }
            curAction.Save();
            curView.ObjectSpace.CommitChanges();
            curAction.Anlage.Reload();
            curView.ObjectSpace.Refresh();
        }
        private void actionRestoreData_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
        {
            RestoreDataParameters p      = e.PopupWindowViewCurrentObject as RestoreDataParameters;
            DetailView            view   = e.PopupWindowView as DetailView;
            ListPropertyEditor    editor = view.FindItem("DeletedItems") as ListPropertyEditor;

            IObjectSpace space = Application.CreateObjectSpace();

            using (AuditTrailRestoreHelper helper = new AuditTrailRestoreHelper(space))
            {
                foreach (RestoreItemDetails details in editor.ListView.SelectedObjects)
                {
                    helper.RestoreObject(space.GetObject <AuditDataItemPersistent>(details.AuditTrailItem));
                }

                helper.MarkAsRestored();
                space.CommitChanges();
            }
        }
Esempio n. 18
0
        private void EditInventoryItemBatchAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            // IObjectSpace newObjectSpace = e.View.ObjectSpace;
            // IObjectSpace newObjectSpace = Application.CreateObjectSpace();
            IObjectSpace newObjectSpace = Application.CreateObjectSpace(View.ObjectTypeInfo.Type);

            objectToShow = (ItemInventoryBatch)newObjectSpace.GetObject(View.CurrentObject);
            //objectToShow = newObjectSpace.GetObject(View.CurrentObject);
            if (objectToShow != null)
            {
                IIB         = (ItemInventoryBatch)View.CurrentObject;
                createdView = Application.CreateDetailView(newObjectSpace, IIB);
                createdView.ViewEditMode = ViewEditMode.Edit;
                e.View       = createdView;
                IIB.LastScan = "";
                E            = e;
                //   IIB.LastScanChangedEvent += IIB_LastScanChangedEvent;
            }
        }
Esempio n. 19
0
        public override Task <ActionResult> Execute(object sender, EventArgs args, object obj)
        {
            DetailView detail = obj as DetailView;

            FrameworkElement ele = sender as FrameworkElement;

            while (!(ele is TimelineView))
            {
                ele = ele.Parent as FrameworkElement;
            }

            if (ele != null)
            {
                TimelineView view = ele as TimelineView;
                view.Remove(detail);
            }

            return(OK);
        }
        private void CopyToDO_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            SalesOrder currentObject = (SalesOrder)View.CurrentObject;

            if (ObjectSpace.IsModified || ObjectSpace.IsNewObject(currentObject))
            {
                MessageOptions options = new MessageOptions();
                options.Message  = "Please save the document 1st.";
                options.Duration = 3000;
                options.Type     = InformationType.Error;
                Application.ShowViewStrategy.ShowMessage(options);
                return;
            }
            IObjectSpace  ios           = Application.CreateObjectSpace();
            DeliveryOrder deliveryOrder = ios.CreateObject <DeliveryOrder>();

            deliveryOrder.CustomerID = deliveryOrder.Session.FindObject <Customers>(new BinaryOperator("Oid", currentObject.CompanyID.Oid));
            foreach (SalesOrderDetail item in currentObject.OrderDetail)
            {
                if (item.OpenQuantity <= 0)
                {
                    continue;
                }
                DeliveryOrderDetail orderDetail = ios.CreateObject <DeliveryOrderDetail>();
                orderDetail.Item     = ios.FindObject <Items>(new BinaryOperator("Oid", item.Item.Oid));
                orderDetail.Item     = ios.GetObjectByKey <Items>(item.Item.Oid);
                orderDetail.Quantity = item.OpenQuantity;
                orderDetail.Price    = item.Price;
                orderDetail.BaseObj  = "Order";
                orderDetail.BaseLine = item.Oid;
                deliveryOrder.OrderDetail.Add(orderDetail);
            }

            ShowViewParameters svp = new ShowViewParameters();
            DetailView         dv  = Application.CreateDetailView(ios, deliveryOrder);

            dv.ViewEditMode = ViewEditMode.Edit;
            dv.IsRoot       = true;
            svp.CreatedView = dv;

            Application.ShowViewStrategy.ShowView(svp, new ShowViewSource(null, null));
        }
        protected override void OnActivated()
        {
            base.OnActivated();
            // Perform various tasks depending on the target View.
            _DetailView = View as DetailView;
            ListPropertyEditor foliosListPropertyEditor = _DetailView.FindItem("Folios") as ListPropertyEditor;

            if (foliosListPropertyEditor != null)
            {
                foliosListPropertyEditor.ControlCreated += foliosListPropertyEditor_ControlCreated;
            }


            ListPropertyEditor chargeRulesListPropertyEditor = ((DetailView)View).FindItem("ChargeRules") as ListPropertyEditor;

            if (chargeRulesListPropertyEditor != null)
            {
                chargeRulesListPropertyEditor.ControlCreated += chargeRulesListPropertyEditor_ControlCreated;
            }
        }
Esempio n. 22
0
        void ReleaseDesignerOutlets()
        {
            if (DetailView != null)
            {
                DetailView.Dispose();
                DetailView = null;
            }

            if (MainOutlineView != null)
            {
                MainOutlineView.Dispose();
                MainOutlineView = null;
            }

            if (MainTableView != null)
            {
                MainTableView.Dispose();
                MainTableView = null;
            }
        }
Esempio n. 23
0
        private void CopyToSTR_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            IObjectSpace os = Application.CreateObjectSpace();
            DetailView   dv = Application.CreateDetailView(os, os.CreateObject <CopyToAction>(), true);

            dv.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit;

            if (((ListView)View).SelectedObjects.Count <= 0)
            {
                ((CopyToAction)dv.CurrentObject).IsErr         = true;
                ((CopyToAction)dv.CurrentObject).ActionMessage = "No Item selected.";
            }
            else
            {
                ((CopyToAction)dv.CurrentObject).IsErr         = false;
                ((CopyToAction)dv.CurrentObject).ActionMessage = "Press OK to CONFIRM the action, else press Cancel.";
            }

            e.View = dv;
        }
        void ReleaseDesignerOutlets()
        {
            if (ThePhoto != null)
            {
                ThePhoto.Dispose();
                ThePhoto = null;
            }

            if (DetailView != null)
            {
                DetailView.Dispose();
                DetailView = null;
            }

            if (PickPhotoButton != null)
            {
                PickPhotoButton.Dispose();
                PickPhotoButton = null;
            }
        }
 private void refreshSelectedDepartment()
 {
     if (treeListEditor != null)
     {
         DetailView dvOwner = View.ObjectSpace.Owner as DetailView;
         if (dvOwner != null && dvOwner.CurrentObject != null && dvOwner.CurrentObject is DocumentEmployees)
         {
             DocumentEmployees curDocEmp = dvOwner.CurrentObject as DocumentEmployees;
             if (curDocEmp != null && curDocEmp.LinkDocument != null)
             {
                 Document curDoc = curDocEmp.LinkDocument as Document;
                 if ((curDoc.DepartmentReceivedsSelected.Count > 0))
                 {
                     treeListEditor.SetControlSelectedObjects(curDoc.DepartmentReceivedsSelected.ToList <object>());
                     isFirstLoad = false;
                 }
             }
         }
     }
 }
        /// <summary>
        /// Handles the Execute event of the AddFilter control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="SimpleActionExecuteEventArgs"/> instance containing the event data.</param>
        private void AddFilter_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            if (View.CurrentObject == null)
            {
                return;
            }

            IObjectSpace       os            = Application.CreateObjectSpace();
            object             CurrentObject = View.CurrentObject;
            FilteringCriterion fc            = os.CreateObject <FilteringCriterion>();

            fc.Public = true;
            fc.User   = os.FindObject <PermissionPolicyUser>(new BinaryOperator("UserName", SecuritySystem.CurrentUserName));
            fc.Objekt = CurrentObject.GetType();
            DetailView view = Application.CreateDetailView(os, "FilteringCriterion_DetailView", true);

            view.CurrentObject = fc;
            view.ViewEditMode  = ViewEditMode.Edit;
            e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
            e.ShowViewParameters.CreatedView  = view;
        }
Esempio n. 27
0
        private void ShowDialogImport_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            IObjectSpace    objectSpace = this.ObjectSpace.CreateNestedObjectSpace();
            ImportDataEXCEL obj         = objectSpace.CreateObject <ImportDataEXCEL>();

            DetailView detailView = Application.CreateDetailView(objectSpace, obj);

            detailView.ViewEditMode           = ViewEditMode.Edit;
            e.ShowViewParameters.CreatedView  = detailView;
            e.ShowViewParameters.Context      = TemplateContext.View;
            e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;

            DialogController dialogController = Application.CreateController <DialogController>();

            dialogController.AcceptAction.Caption   = "Import";
            dialogController.CancelAction.Caption   = "Close";
            dialogController.AcceptAction.Executed += ImportJson_Executed;
            //dialogController.Accepting += new EventHandler<DialogControllerAcceptingEventArgs>(dialogController_Accepting);
            e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
            e.ShowViewParameters.Controllers.Add(dialogController);
        }
Esempio n. 28
0
        public void Proccess(CustomProcessShortcutEventArgs shortcutEventArgs)
        {
            if (shortcutEventArgs.Handled)
            {
                return;
            }
            var shortcut        = shortcutEventArgs.Shortcut;
            var modelDetailView = GetModelDetailView(shortcut);

            if ((modelDetailView != null && IsEnable(modelDetailView)))
            {
                if (CanCreate(modelDetailView.ModelClass.TypeInfo))
                {
                    shortcutEventArgs.Handled = true;
                    var    objectSpace = _application.CreateObjectSpace(modelDetailView.ModelClass.TypeInfo.Type);
                    object obj         = GetObject(shortcut, modelDetailView, objectSpace);
                    _detailView            = _application.CreateDetailView(objectSpace, modelDetailView, true, obj);
                    shortcutEventArgs.View = _detailView;
                }
            }
        }
Esempio n. 29
0
        public ActionResult UserDetails()
        {
            if (!string.IsNullOrEmpty(SessionHelper.ErrorMessage))
            {
                ViewBag.Success = SessionHelper.ErrorMessage;
            }
            else
            {
                ViewBag.Success = "";
            }
            if (Request.QueryString.Count > 0)
            {
                if (Request.QueryString["value"].ToString() == "success")
                {
                    ViewBag.Disabled = "disabled";
                }
            }
            DetailView detailView = userData.GetDetailView(logonUserSession.USERID);

            return(View(detailView));
        }
Esempio n. 30
0
        internal void ShowNewDataSourceDialog()
        {
            IObjectSpace        newDataSourceObjectSpace = objectSpace.CreateNestedObjectSpace();
            Type                dataSourceType           = XafTypesInfo.Instance.FindTypeInfo(documentData.GetType()).FindMember("DataSources").ListElementType;
            IDocumentDataSource dataSource           = (IDocumentDataSource)newDataSourceObjectSpace.CreateObject(dataSourceType);
            DetailView          dataSourceDetailView = application.CreateDetailView(newDataSourceObjectSpace, dataSource);
            ShowViewParameters  svp = new ShowViewParameters(dataSourceDetailView);

            svp.TargetWindow = TargetWindow.NewModalWindow;
            svp.Context      = TemplateContext.PopupWindow;
            DialogController dc = application.CreateController <DialogController>();

            svp.Controllers.Add(dc);
            dc.Accepting += delegate {
                newDataSourceObjectSpace.CommitChanges();
                IDocumentDataSource newDataSource = (IDocumentDataSource)objectSpace.GetObject(dataSource);
                documentData.DataSources.Add(newDataSource);
                AddDataSource(newDataSource, false);
            };
            application.ShowViewStrategy.ShowView(svp, new ShowViewSource(null, null));
        }
Esempio n. 31
0
        /// <summary>
        /// Метод поиска склада по имени
        /// </summary>
        /// <param name="e">Аргументы поступающие в параметризированный action, включая дату</param>
        private void FindFieldDataAction_Execute(object sender, ParametrizedActionExecuteEventArgs e)
        {
            try
            {
                IObjectSpace objectSpace = Application.CreateObjectSpace();
                string       paramValue  = e.ParameterCurrentValue as string;
                object       obj         = objectSpace.FindObject(((ListView)View).ObjectTypeInfo.Type,
                                                                  CriteriaOperator.Parse(string.Format("Contains([Name], '{0}')", paramValue)));

                if (obj != null)
                {
                    DetailView detailView = Application.CreateDetailView(objectSpace, obj);
                    detailView.ViewEditMode          = DevExpress.ExpressApp.Editors.ViewEditMode.Edit;
                    e.ShowViewParameters.CreatedView = detailView;
                }
            }
            catch (Exception ex)
            {
                Tracing.Tracer.LogText(ex.ToString() + "Action : Find Field Data");
            }
        }
Esempio n. 32
0
        private void SelectFilter_Execute(object sender, SingleChoiceActionExecuteEventArgs e)
        {
            CurrentFilterType = e.SelectedChoiceActionItem.Data as Type;

            IObjectSpace os = Application.CreateObjectSpace();

            DetailView dv = Application.CreateDetailView(os, os.CreateObject(CurrentFilterType));

            dv.ViewEditMode = ViewEditMode.Edit;
            ShowViewParameters svp = new ShowViewParameters(dv);

            svp.Context      = TemplateContext.PopupWindow;
            svp.TargetWindow = TargetWindow.NewModalWindow;
            DialogController dc = Application.CreateController <DialogController>();

            dc.Accepting              += new EventHandler <DialogControllerAcceptingEventArgs>(dc_Accepting);
            dc.AcceptAction.Executed  += new EventHandler <ActionBaseEventArgs>(AcceptAction_Executed);
            dc.AcceptAction.Executing += new CancelEventHandler(AcceptAction_Executing);
            svp.Controllers.Add(dc);
            Application.ShowViewStrategy.ShowView(svp, new ShowViewSource(Application.MainWindow, null));
        }
Esempio n. 33
0
        private void ProdOrderP_View_ViewControlsCreated(object sender, EventArgs e)
        {
            detailView = (DetailView)View;
            prodOrderP = (ProdOrderP)detailView.CurrentObject;

            foreach (ControlDetailItem cdi in detailView.GetItems<ControlDetailItem>())
            {
                switch (cdi.Id)
                {
                    case "btnOK":
                        btnOK = (SimpleButton)cdi.Control;
                        btnOK.Text = "出單";
                        btnOK.Click += new EventHandler(btnOK_Click);
                        break;
                    case "btnClose":
                        btnClose = (SimpleButton)cdi.Control;
                        btnClose.Text = "取消";
                        btnClose.Click += new EventHandler(btnClose_Click);
                        break;
                    case "txtAvailQty":
                        txtAvailQty = (TextEdit)cdi.Control;
                        txtAvailQty.Enabled = false;
                        break;
                    case "txtDailyQty":
                        txtDailyQty = (TextEdit)cdi.Control;
                        txtDailyQty.Enabled = false;
                        break;
                    case "txtMachine":
                        txtMachine = (TextEdit)cdi.Control;
                        break;
                    case "txtNeedQty":
                        txtNeedQty = (SpinEdit)cdi.Control;
                        break;
                    case "txtPartName":
                        txtPartName = (TextEdit)cdi.Control;
                        txtPartName.Enabled = false;
                        break;
                    case "txtPartNo":
                        txtPartNo = (TextEdit)cdi.Control;
                        txtPartNo.Enabled = false;
                        break;
                    case "txtResName":
                        txtResName = (TextEdit)cdi.Control;
                        txtResName.Enabled = false;
                        break;
                    case "txtResNo":
                        txtResNo = (TextEdit)cdi.Control;
                        txtResNo.Enabled = false;
                        break;
                    case "txtLackQty":
                        txtLackQty = (TextEdit)cdi.Control;
                        txtLackQty.Enabled = false;
                        break;
                    case "cboWorkOper":
                        cboWorkOper = (ComboBoxEdit)cdi.Control;
                        cboWorkOper.SelectedValueChanged += new EventHandler(cboWorkOper_SelectedValueChanged);
                        break;
                    case "datNeedDate":
                        datNeedDate = (DateEdit)cdi.Control;
                        break;
                }
            }

            initComboBox();
        }
Esempio n. 34
0
 public new void WriteLastLogonParameters(DetailView view, object logonObject) {
     base.WriteLastLogonParameters(view, logonObject);
 }
Esempio n. 35
0
 void ApplicationOnViewShown(object sender, ViewShownEventArgs e) {
     if (_detailView == null) return;
     var recordsNavigationController = e.TargetFrame.GetController<RecordsNavigationController>();
     if (recordsNavigationController==null)return;
     var objectSpace = _application.ObjectSpaceProvider.CreateObjectSpace();
     IList objects = objectSpace.GetObjects(_detailView.ObjectTypeInfo.Type);
     var standaloneOrderProvider = new StandaloneOrderProvider(objectSpace, objects);
     var orderProviderSource = new OrderProviderSource { OrderProvider = standaloneOrderProvider };
     recordsNavigationController.OrderProviderSource = orderProviderSource;
     _application.ViewShown -= ApplicationOnViewShown;
     _detailView = null;
 }
Esempio n. 36
0
 void OnAfterViewShown(object sender, ViewShownEventArgs e) {
     if (_detailView == null) return;
     IObjectSpace objectSpace = _application.ObjectSpaceProvider.CreateObjectSpace();
     IList objects = objectSpace.GetObjects(_detailView.ObjectTypeInfo.Type);
     var standaloneOrderProvider = new StandaloneOrderProvider(objectSpace, objects);
     var orderProviderSource = new OrderProviderSource { OrderProvider = standaloneOrderProvider };
     e.TargetFrame.GetController<RecordsNavigationController>().OrderProviderSource = orderProviderSource;
     ((IXafApplication)_application).AfterViewShown -= OnAfterViewShown;
     _detailView = null;
 }
Esempio n. 37
0
 protected virtual void UpdateViewAllowEditState(DetailView view) {
     if (!XpandModuleBase.IsHosted)
         view.AllowEdit["ViewEditMode"] = view.ViewEditMode == ViewEditMode.Edit;
 }
Esempio n. 38
0
 void IXafApplication.WriteLastLogonParameters(DetailView view, object logonObject) {
     throw new NotImplementedException();
 }
 private void NewObjectAction_Executed(object sender, ActionBaseEventArgs e)
 {
     createdDetailView = e.ShowViewParameters.CreatedView as DetailView;
     //Cancel showing the default View by the NewObjectAction
     e.ShowViewParameters.CreatedView = null;
 }
Esempio n. 40
0
 protected virtual void UpdateViewEditModeState(DetailView view, ViewEditMode viewEditMode) {
     view.ViewEditMode = viewEditMode;
 }
Esempio n. 41
0
 protected virtual void UpdateViewAllowEditState(DetailView view) {
     if (!ApplicationHelper.Instance.Application.IsHosted()) {
         view.AllowEdit[ViewActiveKey] = view.ViewEditMode == ViewEditMode.Edit;
     }
 }