Ejemplo n.º 1
0
        internal async Task <int> AddTaskAsync(GrpcChannel channel,
                                               int managerId,
                                               int assignedEmployee,
                                               DateTime createDate,
                                               string description,
                                               DateTime finalDate,
                                               PriorityEnum priority,
                                               string subject)
        {
            var client = new Tasks.TasksClient(channel);
            var input  = new TaskInput
            {
                ManagerId        = managerId,
                AssignedEmployee = assignedEmployee,
                CreateDate       = createDate.Date.ToUniversalTime().ToTimestamp(),
                Description      = description,
                FinalDate        = finalDate.Date.ToUniversalTime().ToTimestamp(),
                Priority         = priority.ToString(),
                Subject          = subject
            };
            var taskId = await client.AddTaskAsync(input);

            await SendUpdateEventAsync(channel, assignedEmployee);

            return(taskId.Value);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method Displays a Note
        /// </summary>
        public void DisplayNote()
        {
            // initial values
            string       title       = "";
            string       description = "";
            PriorityEnum priority    = PriorityEnum.Normal;
            int          noteId      = 0;

            // if the object exists
            if (this.HasNote)
            {
                // set the values
                title       = Note.Title;
                description = Note.Description;
                priority    = Note.Priority;
                noteId      = Note.Id;
            }

            // display the values
            this.TitleControl.Text             = title;
            this.DescriptionControl.Text       = description;
            this.PriorityControl.SelectedIndex = PriorityControl.FindItemIndexByValue(priority.ToString());
            this.IdControl.Text = noteId.ToString();

            // display the note in the Note Editor
            this.Text = "Note Editor - " + noteId;
        }