|
@@ -22,45 +22,47 @@ namespace ROGOZ.Pages
|
|
|
/// </summary>
|
|
|
public partial class AddEditPage : Page
|
|
|
{
|
|
|
- private user1Entities _context = new user1Entities();
|
|
|
- private List<string> listUsers = new List<string>();
|
|
|
+ //private user1Entities _context = new user1Entities();
|
|
|
+ //private List<string> listUsers = new List<string>();
|
|
|
private Task _currentTask = null;
|
|
|
|
|
|
|
|
|
public AddEditPage()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- //DPCreateDateTime.SelectedDate = DateTime.Today;
|
|
|
- //DPDeadLine.SelectedDate = DateTime.Today;
|
|
|
DataContext = _currentTask;
|
|
|
CmbStatus.ItemsSource = Status.FillStatus();
|
|
|
CmbTaskType.ItemsSource = WorkType.FillWorkType();
|
|
|
- foreach (var user in _context.User.ToList())
|
|
|
- {
|
|
|
- listUsers.Add(user.getFamilia());
|
|
|
- }
|
|
|
- CmbExecutor.ItemsSource = listUsers;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //foreach (var user in _context.User.ToList())
|
|
|
+ //{
|
|
|
+ // listUsers.Add(user.getFamilia());
|
|
|
+ //}
|
|
|
+ //CmbExecutor.ItemsSource = listUsers;
|
|
|
}
|
|
|
|
|
|
public AddEditPage(Task selectedTask)
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- //DPCreateDateTime.DisplayDate = DateTime.Now.Date;
|
|
|
- //DPDeadLine.SelectedDate = DateTime.Today;
|
|
|
_currentTask = selectedTask;
|
|
|
CmbStatus.ItemsSource = Status.FillStatus();
|
|
|
CmbExecutor.ItemsSource = user1Entities.GetContext().User.ToList();
|
|
|
- //CmbExecutor.ItemsSource = listUsers;
|
|
|
CmbTaskType.ItemsSource = WorkType.FillWorkType();
|
|
|
if (selectedTask != null)
|
|
|
_currentTask = selectedTask;
|
|
|
DataContext = _currentTask;
|
|
|
|
|
|
- foreach (var user in _context.User.ToList())
|
|
|
- {
|
|
|
- listUsers.Add(user.getFamilia());
|
|
|
- }
|
|
|
- CmbExecutor.ItemsSource = listUsers;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //foreach (var user in _context.User.ToList())
|
|
|
+ //{
|
|
|
+ // listUsers.Add(user.getFamilia());
|
|
|
+ //}
|
|
|
+ //CmbExecutor.ItemsSource = listUsers;
|
|
|
+ //CmbExecutor.ItemsSource = _currentTask.Executor.User.getFamilia();
|
|
|
}
|
|
|
private void BtnCancel_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
@@ -98,7 +100,8 @@ namespace ROGOZ.Pages
|
|
|
{
|
|
|
//ExecutorID = CmbExecutor.,
|
|
|
|
|
|
- //Executor = user1Entities.GetContext().Executor.FirstOrDefault(o=>o.User.getFamilia()== CmbExecutor.Text),
|
|
|
+ //Executor = int.Parse(user1Entities.GetContext().Executor.FirstOrDefault(o=>o.User.getFamilia()== CmbExecutor.Text)),
|
|
|
+ ExecutorID = int.Parse(CmbExecutor.Text),
|
|
|
Title = TaskNameTB.Text,
|
|
|
Description = TaskDescriptionTB.Text,
|
|
|
CreateDateTime = DateTime.Parse(DPCreateDateTime.Text),
|