예제 #1
0
        public NewTaskForm(MOG_TaskInfo task)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            mogControl_TaskEditor.Initialize(task);
        }
예제 #2
0
        /// <summary>
        /// Initialize our fields with the data within this task
        /// </summary>
        /// <param name="TaskInfo"></param>
        public void Initialize(MOG_TaskInfo TaskInfo)
        {
            // Make sure we have a valid task
            if (TaskInfo != null)
            {
                // Save the original
                mOriginalTaskInfo = TaskInfo.Clone();

                // Set our task member var
                mTaskInfo = TaskInfo;

                // Populate the priorities
                PopulatePriority();
                // Populate the assigned to
                PopulateAssignTo();

                // Set the name
                this.TaskName       = mTaskInfo.GetName();
                this.TaskPercentage = mTaskInfo.GetPercentComplete();
                this.TaskPriority   = mTaskInfo.GetPriority();
                this.TaskAssignedTo = mTaskInfo.GetAssignedTo();
                this.TaskComments   = mTaskInfo.GetComment();
                GetAssignedAssets();
//				this.TaskAssignedAsset = mTaskInfo.GetAsset();

                // Set the due date
                if (mTaskInfo.GetDueDate() != null)
                {
                    MOG_Time time = new MOG_Time(mTaskInfo.GetDueDate());
                    TaskDueDateTimePicker.Value = time.ToDateTime();
                }

                // Set our importance rating
                TaskImportanceTextBox.Text = mTaskInfo.GetImportanceRating().ToString();
            }
            else
            {
                // Clear out our data
                this.TaskName       = "";
                this.TaskPriority   = "";
                this.TaskAssignedTo = "";
                this.TaskPercentage = -1;
                this.TaskComments   = "";
//
//				TaskPriorityComboBox.Enabled = false;
//				TaskUsersComboBox.Enabled = false;
//				TaskDueDateTimePicker.Enabled = false;
            }
        }