Ejemplo n.º 1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (NewName.Text.Length != 0)
     {
         var newEmployee = new Employee(NewName.Text);
         BDStaffController.AddEmployee(newEmployee);
         afterText.Text = newEmployee.ToString();
     }
     Create.IsEnabled = false;
 }
Ejemplo n.º 2
0
        private void SetFormatedStaff()
        {
            string str = "";

            foreach (var employee in BDStaffController.GetAllStaffIdList())
            {
                str += employee.ToString() + '\n';
            }
            Staff.Text = str;
        }
Ejemplo n.º 3
0
        public static List <Report> GetAllReportsOfUnderlings(Guid id)
        {
            var res = new List <Report>();

            foreach (var underlingId in BDStaffController.GetEmployee(id).Underlings)
            {
                res.AddRange(GetAllReportsOfEmployee(underlingId));
            }

            return(res);
        }
Ejemplo n.º 4
0
        public override string ToString()
        {
            string s = "";

            foreach (var task in SolvedTasks)
            {
                s += task.Name + '\n';
            }
            return("Отчет\n" +
                   $"Создатель отчета - {BDStaffController.GetEmployee(Owner).Name}\n" +
                   $"Описание - {Description}\n" +
                   $"Выполненные задачи:\n {s}");
        }
Ejemplo n.º 5
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            Guid lId;
            bool isLIdGuid = Guid.TryParse(LName.Text, out lId);
            Guid eId;
            bool isEIdGuid = Guid.TryParse(EName.Text, out eId);

            if (isEIdGuid && isLIdGuid)
            {
                BDStaffController.SetNewLeader(lId, eId);
                MessageBox.Show("Успех");
                Save.IsEnabled = false;
            }
            else
            {
                MessageBox.Show("Неверные id");
            }
        }
Ejemplo n.º 6
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            Guid idEmplSprint;

            if (!Guid.TryParse(EId.Text, out idEmplSprint))
            {
                MessageBox.Show("Неправильный формат id");
            }
            else
            {
                var descSprintRep = TDisc.Text;
                BDReportsController.CreateSprintReport(idEmplSprint, descSprintRep);
                if (BDStaffController.GetEmployee(idEmplSprint).IsTeamLead)
                {
                    MessageBox.Show("Отчет за спринт\n" +
                                    BDReportsController.GetSprintReport());
                    Environment.Exit(0);
                }
            }
        }