예제 #1
0
        //private void SetDepartmentsTable()
        //{
        //    DataTable departmentsDataTable = new DataTable();
        //    departmentsDataTable.Columns.Add("ID", typeof(int));
        //    departmentsDataTable.Columns.Add("Name", typeof(string));
        //    departmentsDataTable.Columns.Add("Description", typeof(string));
        //    departmentsDataTable.Columns.Add("Departman aktivan", typeof(bool));

        //    foreach (Department departments in Company.Instance.Departments.Values)
        //    {
        //        departmentsDataTable.Rows.Add(new object[] { departments.DepartmentId, departments.Name, departments.Description, departments.IsDepartmentActive });
        //    }

        //    departments_dgv.DataSource = departmentsDataTable;
        //}
        #endregion

        private void addDep_btn_Click(object sender, System.EventArgs e)
        {
            Hide();
            var addDepartment = new AddDepartmentForm();

            addDepartment.ShowDialog();
            Close();
        }
예제 #2
0
        public override void HandleEditEvent(object selectedItem)
        {
            var editDepartmentForm = new AddDepartmentForm(((Department)selectedItem));

            if (((Department)selectedItem).Id != 1 && ((Department)selectedItem).IsDepartmentActive == true)
            {
                editDepartmentForm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Departman ne moze biti izmenjen!");
                CloseDialog();
            }
        }
예제 #3
0
        public override void HandleAddEvent()
        {
            var addDepartment = new AddDepartmentForm();

            addDepartment.ShowDialog();
        }