Beispiel #1
0
        /// <summary>
        /// Search in the ReferenceData dictionary the object for given type and key
        /// and added to selected Time
        /// </summary>
        /// <param name="key">selected item from UI</param>
        public bool OnProjectSelected(string key, int index)
        {
            msdyn_project selectedProject = this.GetObjectByName <msdyn_project>(key);

            if (selectedProject != null)
            {
                if (Time.msdyn_project == null || selectedProject.Id != Time.msdyn_project.Id)
                {
                    EntityReference newReference = new EntityReference(msdyn_project.EntityLogicalName, selectedProject.Id);
                    Time.msdyn_project = newReference;
                }
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Search in the ReferenceData dictionary the object for given type and key
        /// and added to selected Expense
        /// </summary>
        /// <param name="key">selected item from UI</param>
        public async Task <bool> OnProjectSelected(string selectedItemKey, int selectedItemIndex)
        {
            msdyn_project selectedProject = this.GetObjectByName <msdyn_project>(selectedItemKey);

            if (selectedProject != null)
            {
                if (Expense.msdyn_Project == null || selectedProject.Id != Expense.msdyn_Project.Id)
                {
                    EntityReference newReference = new EntityReference(msdyn_project.EntityLogicalName, selectedProject.Id);
                    Expense.msdyn_Project = newReference;
                }
                return(true);
            }
            return(false);
        }