コード例 #1
0
ファイル: IWMainForm.cs プロジェクト: Winsor/ITInfra
 private void miAddTask_Click(object sender, EventArgs e)
 {
     if (SharedAppData.IsAccesible(TaskEditor.ObjectAccessId))
     {
         TaskEditor taskEditor = new TaskEditor(_dataContexts,TaskEditor.FormState.FormNew) {Text = @"Добавление работы"};
         if (taskEditor.ShowDialog(this) == DialogResult.OK)
         {
             RefreshCurrentPage();
             _clientProcessor.SendEventNotify(Guid.NewGuid());
             FocusChangedWork(taskEditor.EditedWorkId);
         }
     }
     else
     {
         MessageBox.Show(@"Отсутсвуют права на использование [" + TaskEditor.ObjectAccessId.Description + @"]!");
     }
 }
コード例 #2
0
ファイル: IWMainForm.cs プロジェクト: Winsor/ITInfra
 private void miChangeTask_Click(object sender, EventArgs e)
 {
     if (SharedAppData.IsAccesible(TaskEditor.ObjectAccessId))
     {
         if (gvWorkTasks.SelectedRows.Count != 1)
             return;
         WorkInfo selectedWork = gvWorkTasks.SelectedRows[0].DataBoundItem as WorkInfo;
         if (selectedWork == null)
             throw new InvalidCastException();
         TaskEditor.FormState state = SharedAppData.IsFlagSet(ObjectAccessId, RightsFlags.Change) ? TaskEditor.FormState.FormEdit : TaskEditor.FormState.FormView;
         TaskEditor taskEditor = new TaskEditor(_dataContexts, state,selectedWork.WorkId);
         if (taskEditor.ShowDialog(this) == DialogResult.OK)
         {
             RefreshCurrentPage();
             _clientProcessor.SendEventNotify(Guid.NewGuid());
             FocusChangedWork(taskEditor.EditedWorkId);
         }
     }
     else
     {
         MessageBox.Show(@"Отсутсвуют права на использование [" + TaskEditor.ObjectAccessId.Description + @"]!");
     }
 }