Kadr.Data.Dep.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            if (PlanStaff != null)
            {
                try
                {
                    //берем первого руководителя из списка неуволенных
                    FactStaff factStaff = PlanStaff.FactStaffs.Where(fctStaff => fctStaff.Prikaz == null).First() as FactStaff;
                    if (factStaff != null)
                        return this.DepartmentSmallName + " (" + factStaff.ToString() + ")";
                }
                catch (InvalidOperationException)
                {
                    return this.DepartmentSmallName;
                }
            }
            return this.DepartmentSmallName;
        }