Ejemplo n.º 1
0
        private bool SaveComplain()
        {
            try
            {
                _complainService.InsertOrUpdate(SelectedComplain);

                if (SelectedComplain.Status == ComplainStatusTypes.Opened)
                {
                    Employee.CurrentStatus = ProcessStatusTypes.WithComplain;
                }
                else
                {
                    if (SelectedComplain.Status == ComplainStatusTypes.Closed &&
                        Complains.Count(c => c.Status == ComplainStatusTypes.Opened) == 0)
                    {
                        Employee.CurrentStatus = ProcessStatusTypes.OnGoodCondition;
                    }
                }
                _employeeService.InsertOrUpdate(Employee);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        private bool SaveComplain()
        {
            try
            {
                if (SelectedEmployee == null || SelectedComplain.FinalSolutionDate == null)
                {
                    return(false);
                }

                SelectedComplain.Status = ComplainStatusTypes.Closed;
                _complainService.InsertOrUpdate(SelectedComplain);

                SelectedEmployee.CurrentComplain = null;
                _employeeService.InsertOrUpdate(SelectedEmployee);

                return(true);
            }
            catch
            {
                return(false);
            }
        }