Exemple #1
0
        public AddNewTask(string globalId, string taskName, string description,
                          TaskClass.SenderApplications senderApplication,
                          bool isDeadLine = false, DateTime deadLine = new DateTime())
        {
            InitializeComponent();

            CreateCollections();

            App.BaseClass.GetTaskClass(ref _taskClass);
            App.BaseClass.GetStaffClass(ref _staffClass);
            App.BaseClass.GetNewsFeedClass(ref _newsFeedClass);

            _openingType         = AddNewTaskOpeningType.AddingBasedOnValues;
            _globalId            = globalId;
            _senderApplication   = senderApplication;
            TaskName.Text        = taskName;
            TaskDescription.Text = description;

            if (isDeadLine)
            {
                IsDeadLineEnable.IsChecked = true;
                DeadLineDate.SelectedDate  = deadLine;
            }

            FillPerformers();
            FillObservers();
            SetBindings();
        }
Exemple #2
0
        public AddNewTask(TaskClass.SenderApplications senderApplication)
        {
            InitializeComponent();

            CreateCollections();

            App.BaseClass.GetTaskClass(ref _taskClass);
            App.BaseClass.GetStaffClass(ref _staffClass);
            App.BaseClass.GetNewsFeedClass(ref _newsFeedClass);

            _openingType       = AddNewTaskOpeningType.AddingEmpty;
            _senderApplication = senderApplication;
            _taskId            = -1;

            FillPerformers();
            FillObservers();
            SetBindings();
        }
        private void OnReceiveButtonClick(object sender, RoutedEventArgs e)
        {
            var request = MainDataGrid.SelectedItem as DataRowView;

            if (request == null)
            {
                return;
            }

            var globalId = request["GlobalID"].ToString();
            var taskName = new IdToWorkSectionConverter().Convert(request["WorkSectionID"], typeof(string), null,
                                                                  CultureInfo.InvariantCulture).ToString();
            var taskDescription = request["RequestNotes"].ToString();
            const TaskClass.SenderApplications senderApplication = TaskClass.SenderApplications.TechnologyProblem;

            var addNewTaskWindow = new AddNewTask(globalId, taskName, taskDescription, senderApplication);
            var mainWindow       = Window.GetWindow(this) as MainWindow;

            if (mainWindow != null)
            {
                mainWindow.ShowCatalogGrid(addNewTaskWindow, "Выбрать исполнителей");
            }
        }