コード例 #1
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 public DepartmentWindow(DataRow CurrentDepartment)
 {
     InitializeComponent();
     p = new DepartmentPresenter(this, CurrentDepartment);
     btnConfirm.Click += delegate
     {
         p.SaveData();
         DialogResult = true;
     };
     btnConfirm.Click += delegate { Close(); };
     this.Loaded      += delegate { p.LoadData(); };
 }
コード例 #2
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 public DepartmentWindow(Department CurrentDepartment)
 {
     InitializeComponent();
     p = new DepartmentPresenter(this, CurrentDepartment);
     if (CurrentDepartment == null)
     {
         btnConfirm.Click += delegate { p.AddDepartment(); };
     }
     else
     {
         btnConfirm.Click += delegate { p.UpdateDepartment(); };
     }
     btnConfirm.Click += delegate { Close(); };
     this.Loaded      += delegate { p.LoadData(); };
 }