void ObjectSpaceOnObjectSaving(object sender, ObjectManipulatingEventArgs args) {
     var store = (args.Object) as UserModelDifferenceObject;
     if (store != null && ReferenceEquals(GetDifference(Application.GetType().FullName, store.Name), store)) {
         ModelApplicationBase modelApplicationBase = ((ModelApplicationBase)Application.Model).LastLayer;
         new ModelXmlReader().ReadFromModel(modelApplicationBase, store.Model);
     }
 }
 void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs objectManipulatingEventArgs)
 {
     if (isNewObject)
     {
         InvokeNewObjectSaved(new NewObjectSavedEventArgs(objectManipulatingEventArgs.Object));
     }
 }
 void ObjectSpaceOnObjectSaving(object sender, ObjectManipulatingEventArgs objectManipulatingEventArgs)
 {
     if (objectManipulatingEventArgs.Object == View.CurrentObject)
     {
         isNewObject = View.ObjectSpace.IsNewObject(View.CurrentObject);
     }
 }
示例#4
0
 private void ObjectSpace_ObjectSaving(object sender, ObjectManipulatingEventArgs e)
 {
     if (this.Employee.EmployeeType == Ignyt.BusinessInterface.EmployeeType.SystemUser)
     {
         MultiTenantHelper.CreateUser(this.Employee);
     }
 }
示例#5
0
 protected override void OnSaving(ObjectManipulatingEventArgs <IPersistentReferenceMemberInfo> e)
 {
     base.OnSaving(e);
     if (e.Object.RelationType == RelationType.OneToMany && e.Object.IsAssociation())
     {
         createTheManyPart(e.Object);
     }
 }
        private void ObjectSpace_ObjectSaving(object sender, ObjectManipulatingEventArgs e)
        {
            var cashFlow = e.Object as CashFlow;

            if (cashFlow != null && !cashFlow.IsDeleted)
            {
            }
        }
示例#7
0
        void ObjectSpace_ObjectSaving(object sender, ObjectManipulatingEventArgs e)
        {
            string siteMode = System.Configuration.ConfigurationManager.AppSettings["SiteMode"];

            if (siteMode != null && siteMode.ToLower() == "true")
            {
                throw new InvalidOperationException("Data modifications are not allowed in this demo.");
            }
        }
示例#8
0
        void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs args)
        {
            var permission = (args.Object) as IPersistentPermission;

            if (permission != null && permission.Permission is LogicRulePermission)
            {
                CollectRules();
            }
        }
示例#9
0
        //Saved
        private void ObjectSpace_ObjectSaved(object sender, ObjectManipulatingEventArgs e)
        {
            //NotificationObjects objNotifyCur = module.NotificationObjects.Find(obj => obj.ObjectType == e.Object.GetType());

            //if (objNotifyCur != null)
            //{
            //    CriteriaOperator criteria = CriteriaOperator.Parse(objNotifyCur.ObjectCriteria);
            //    bool? matchCriteria = ObjectSpace.IsObjectFitForCriteria(objNotifyCur.ObjectType, e.Object, criteria);
            //    if (matchCriteria == true)
            //    {
            //        //Get Emails//
            //        int intOid = (int)View.ObjectSpace.GetKeyValue(View.CurrentObject);
            //        ObjectNotificationDetails objNotfDtl = ObjectSpace.GetObjects<ObjectNotificationDetails>().Where(
            //            not => not.ObjectType == objNotifyCur.ObjectType.ToString() && not.ObjectOid == intOid).FirstOrDefault();
            //        List<int> lstUserIds = objNotfDtl.UsersToSendEmail.Split('|').Select(Int32.Parse).ToList();
            //        lstEmails = ObjectSpace.GetObjects<NotificationUser>().Where(nu => lstUserIds.Contains(nu.Oid)).
            //            Select(usr => usr.Email).ToList();

            //        List<INotification> lstNotification = new List<INotification>();
            //        if (lstEmails.Count > 0)
            //        {
            //            if (objNotifyCur.IsNotificationForDeletion && IsDeleted)//Deletion
            //            {
            //                lstNotification = Notification.SendNotification(lstEmails, objNotfDtl.TemplateForDelete);
            //            }
            //            else
            //            {
            //                if (objNotifyCur.IsNotificationForCreation && IsNewObject)//Creation
            //                {
            //                    lstNotification = Notification.SendNotification(lstEmails, objNotfDtl.TemplateForSave);
            //                }
            //                if (objNotifyCur.IsNotificationForUpdation && !IsNewObject)//Updation
            //                {
            //                    lstNotification = Notification.SendNotification(lstEmails, objNotfDtl.TemplateForUpdate);
            //                }
            //            }

            //            //Update Notification table//
            //            INotification objNotification;
            //            foreach (Notification objNot in lstNotification)
            //            {
            //                //ObjectSpace.CreateObject(commentType) as IComment;
            //                IObjectSpace objObSpc = Application.CreateObjectSpace();
            //                objNotification = (Notification)objObSpc.CreateObject(typeof(Notification)) as INotification;
            //                objNotification.Email = objNot.Email;
            //                objNotification.NotificationType = objNot.NotificationType;
            //                objNotification.EmailDate = objNot.EmailDate;
            //                objNotification.Message = objNot.Message;
            //                objNotification.Status = objNot.Status;
            //                objObSpc.CommitChanges();
            //            }

            //            lstEmails = new List<string>();
            //        }
            //    }
            //}
        }
示例#10
0
        private void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs args)
        {
            var permission = (args.Object) as IPersistentPermission;

            if (permission != null && permission.Permission is ArtifactStateRulePermission)
            {
                ModelArtifactStateModule.CollectRules(Application);
            }
        }
示例#11
0
        void ObjectSpaceOnObjectSaving(object sender, ObjectManipulatingEventArgs args)
        {
            var store = (args.Object) as UserModelDifferenceObject;

            if (store != null && ReferenceEquals(GetDifference(Application.GetType().FullName, store.Name), store))
            {
                ModelApplicationBase modelApplicationBase = ((ModelApplicationBase)Application.Model).LastLayer;
                new ModelXmlReader().ReadFromModel(modelApplicationBase, store.Model);
            }
        }
示例#12
0
        //

        //Saving
        private void ObjectSpace_ObjectSaving(object sender, ObjectManipulatingEventArgs e)
        {
            NotificationObjects objNotifyObj = module.NotificationObjects.Find(obj => obj.ObjectType == e.Object.GetType());

            if (ObjectSpace != null && objNotifyObj != null)
            {
                IsNewObject = ObjectSpace.IsNewObject(objNotifyObj);
                IsDeleted   = ObjectSpace.IsDeletedObject(objNotifyObj);
            }
        }
示例#13
0
 private void ObjectSpace_ObjectReloaded(Object sender, ObjectManipulatingEventArgs e)
 {
     if ((objects != null) && (e.Object != null) && objectType.IsAssignableFrom(e.Object.GetType()))
     {
         Int32 index = objects.IndexOf(e.Object);
         if (index >= 0)
         {
             RaiseListChangedEvent(new ListChangedEventArgs(ListChangedType.ItemChanged, index, -1));
         }
     }
 }
 private void ObjectSpaceOnObjectSaving(object sender, ObjectManipulatingEventArgs args)
 {
     if (args.Object is TaxonomyBaseObjectInfo){
         var taxonomyBaseObjectInfo = ((TaxonomyBaseObjectInfo) args.Object);
         Term oldCategory = taxonomyBaseObjectInfo.Category;
         Term newCategory = new Term(taxonomyBaseObjectInfo.Session){
                                                                        ParentTerm = oldCategory,
                                                                        Key = taxonomyBaseObjectInfo.Owner.ToString()
                                                                    };
         taxonomyBaseObjectInfo.Category = newCategory;
     }
 }
        private void ObjectSpace_ObjectReloaded(object sender, ObjectManipulatingEventArgs e)
        {
            if (this.objects == null || e.Object == null || !this.objectType.IsAssignableFrom(e.Object.GetType()))
            {
                return;
            }
            int newIndex = this.objects.IndexOf(e.Object);

            if (newIndex < 0)
            {
                return;
            }
            this.RaiseListChangedEvent(new ListChangedEventArgs(ListChangedType.ItemChanged, newIndex, -1));
        }
        void ObjectSpaceOnObjectSaving(object sender, ObjectManipulatingEventArgs args)
        {
            var userModelDifferenceObject = args.Object as UserModelDifferenceObject;

            if (userModelDifferenceObject != null && ReferenceEquals(GetDifference(Application.GetType().FullName, userModelDifferenceObject.Name), userModelDifferenceObject))
            {
                var modelApplicationBase = ((ModelApplicationBase)Application.Model).LastLayer;
                foreach (var aspectObject in userModelDifferenceObject.AspectObjects)
                {
                    var name = aspectObject.Name == CaptionHelper.DefaultLanguage ? "" : aspectObject.Name;
                    new ModelXmlReader().ReadFromString(modelApplicationBase, name, aspectObject.Xml);
                }
            }
        }
        void ObjectSpace_ObjectSaving(object sender, ObjectManipulatingEventArgs e)
        {
            Contact contact = e.Object as Contact;

            if (contact != null && ObjectSpace.IsNewObject(contact) && contact.Photo == null)
            {
                MemoryStream ms    = new MemoryStream();
                Image        image = ImageLoader.Instance.GetImageInfo("NoProfileImage").Image;
                lock (image) {
                    image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                }
                contact.Photo = ms.ToArray();
            }
        }
示例#18
0
        private void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs args)
        {
            var userModelDifferenceObject = args.Object as UserModelDifferenceObject;

            if (userModelDifferenceObject != null && ReferenceEquals(GetDifference(Application.GetType().FullName, userModelDifferenceObject.Name, userModelDifferenceObject.DeviceCategory), userModelDifferenceObject))
            {
                var applicationModel = (ModelApplicationBase)Application.Model;
                var model            = applicationModel.CreatorInstance.CreateModelApplication();
                model.Id = applicationModel.LastLayer.Id;
                foreach (var aspectObject in userModelDifferenceObject.AspectObjects.Where(o => !string.IsNullOrWhiteSpace(o.Xml)))
                {
                    new ModelXmlReader().ReadFromString(model, userModelDifferenceObject.GetAspectName(aspectObject),
                                                        aspectObject.Xml);
                }
                ModelApplicationHelper.RemoveLayer(applicationModel);
                ModelApplicationHelper.AddLayer(applicationModel, model);
            }
        }
示例#19
0
        private void ObjectSaving(object sender, ObjectManipulatingEventArgs e)
        {
            var compilationHelper = new ScriptCompilationHelper(AssembliesHelper.GetReferencedAssembliesPaths(Application));
            var script            = (e.Object as IDashboardDataExtract).Script;
            var tempFile          = Path.GetTempFileName();
            var compileResult     = compilationHelper.Compile(script, tempFile);

            File.Delete(tempFile);

            if (!compileResult.Success)
            {
                var errors = compileResult.Diagnostics
                             .Where(o => o.Severity == DiagnosticSeverity.Error)
                             .Select(o => o.ToString());

                throw new UserFriendlyException(string.Join("\n", errors));
            }
        }
        private void SpaceOnObjectSaving(object sender, ObjectManipulatingEventArgs args){
            if (ReferenceEquals(args.Object, CurrentObject)){
                Control.Controller.Dictionary.Validate();
                ModifyCurrentObjectModel();
                Control.Controller.Save();
            }

        }
示例#21
0
 private void ObjectSpace_ObjectReloaded(Object sender, ObjectManipulatingEventArgs e)
 {
     if ((objects != null) && (e.Object != null) && objectType.IsAssignableFrom(e.Object.GetType()))
     {
         Int32 index = objects.IndexOf(e.Object);
         if (index >= 0)
         {
             RaiseListChangedEvent(new ListChangedEventArgs(ListChangedType.ItemChanged, index, -1));
         }
     }
 }
 private void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs args) {
     var permission = (args.Object) as IPersistentPermission;
     if (permission != null && permission.Permission is ArtifactStateRulePermission) {
         ModelArtifactStateModule.CollectRules(Application);
     }
 }
 void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs args) {
     var permission = (args.Object) as IPersistentPermission;
     if (permission != null && permission.Permission is LogicRulePermission) {
         CollectRules();
     }
 }
示例#24
0
 private void ObjectSpace_ObjectSaved(object sender, ObjectManipulatingEventArgs e)
 {
     EnableButton();
 }
示例#25
0
 private void ObjectSpace_ObjectSaved(object sender, ObjectManipulatingEventArgs e)
 {
     IWorkflowHelper.ConvertSaved(this.TargetObject, this.SourceObject);
     TargetObjectSaved = true;
 }
 private void ObjectSpaceOnObjectSaved(object sender, ObjectManipulatingEventArgs args){
     DictionaryHelper.AddFields(((ModelDifferenceObject) View.CurrentObject).Model.RootNode, XafTypesInfo.XpoTypeInfoSource.XPDictionary);
 }
 private void ObjectSpace_ObjectReloaded(object sender, ObjectManipulatingEventArgs e)
 {
     ValidateViewObjects();
 }
 private void ObjectSpace_ObjectSaving(object sender, ObjectManipulatingEventArgs e)
 {
     EntityScriptUtil.RunScriptsFor(e.Object, WhenToRun.OnSaving, sender as IObjectSpace);
 }