Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected string UseTaskCommentForm()
- {
- string comment = string.Empty;
- Type taskCommentFormType =
- typeof(MainControl).Assembly.GetType("DocsVision.BackOffice.Cards.CardTask.TaskCommentForm");
- if (taskCommentFormType != null)
- {
- ConstructorInfo method = taskCommentFormType.GetConstructor(
- BindingFlags.Public | BindingFlags.Instance,
- null,
- new[] { typeof(ObjectContext), typeof(string), typeof(StaffEmployee), typeof(DateTime), typeof(bool) },
- null
- );
- object o = method.Invoke(new object[] { Context, comment, StaffService.GetCurrentEmployee(), DateTime.Now, false });
- var taskCommentForm = o as XtraForm;
- if (taskCommentForm.ShowDialog() == DialogResult.OK)
- {
- var prop = taskCommentForm.GetType().GetProperty("Comment");
- if (prop != null)
- {
- comment = prop.GetValue(taskCommentForm, null).ToString();
- }
- }
- else
- {
- comment = "Cancel";
- }
- taskCommentForm.Dispose();
- }
- return comment;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement