Ejemplo n.º 1
0
        /// <summary>
        /// Submit all the time entries that are selected.
        /// </summary>
        /// <returns></returns>
        public async Tasks.Task <bool> SubmitSelectedTimeEntries()
        {
            TimeEntrySubmitter submitter = new TimeEntrySubmitter();

            submitter.DataAccess = this.DataAccess;

            foreach (msdyn_timeentry timeEntry in this.SelectedEntries())
            {
                msdyn_timeentry_msdyn_entrystatus?status = timeEntry.EntryStatus;
                if (status == null || status.Value != msdyn_timeentry_msdyn_entrystatus.Submitted)
                {
                    submitter.addTimeEntry(timeEntry);
                }
            }

            return(await submitter.ExecuteAction());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Submit the time entry.
        /// </summary>
        /// <returns>true if the submission succeeded; otherwise, false.</returns>
        public virtual async Tasks.Task <bool> Submit()
        {
            if (this.CanEdit())
            {
                msdyn_timeentry time   = this.Time;
                bool            result = await this.Save();

                if (result)
                {
                    TimeEntrySubmitter submitter = new TimeEntrySubmitter();
                    submitter.DataAccess = this.DataAccess;
                    submitter.addTimeEntry(this.Time);

                    return(await submitter.ExecuteAction());
                }
                else
                {
                    await MessageCenter.ShowErrorMessage(AppResources.SaveError);
                }
            }
            return(false);
        }