示例#1
0
    /// <summary>
    /// Loads vote data from User Interface and returns it
    /// </summary>
    /// <returns>Vote</returns>
    private EmployeeVote GetVoteFromUI()
    {
        EmployeeVote vote = new EmployeeVote();

        vote.Date        = DateTime.Now;
        vote.AccountFrom = ProgramClasses.GetCurrentAccount(); // ToDo: Добавить стратегию
        vote.AccountTo   = GetVotedAccount();                  // ToDo: Добавить стратегию
        switch (RadioButtonListValues.SelectedValue)
        {
        case "TeamSpirit":
            vote.CorporateValue = Value.TeamSpirit;
            break;

        case "Innovation":
            vote.CorporateValue = Value.Innovation;
            break;

        case "Commitment":
            vote.CorporateValue = Value.Commitment;
            break;

        case "Responsibility":
            vote.CorporateValue = Value.Responsibility;
            break;

        default:
            vote.CorporateValue = Value.Unknown;
            break;
        }

        vote.Comment = TextBoxComment.Text;

        return(vote);
    }
示例#2
0
    private Employee GetCurrentUser()
    {
        Employee employee = new Employee();

        employee.Account            = ProgramClasses.GetCurrentAccount();
        employee.WelcomeNoShowCheck = voteDataStrategy.GetWelcomeNoShowCheck(employee.Account);
        employee.SelectedLanguage   = voteDataStrategy.GetSelectedLanguage(employee.Account);
        return(employee);
    }
示例#3
0
    /// <summary>
    /// Returns current user info
    /// </summary>
    /// <returns>Current user info</returns>
    private Employee GetCurrentUser()
    {
        Employee employee = new Employee();

        employee.Account      = ProgramClasses.GetCurrentAccount(); // ToDo: Добавить стратегию
        employee.EmployeeName = voteDataStrategy.GetEmployeeName(employee.Account);
        employee.Department   = voteDataStrategy.GetDepartment(employee.Account);
        employee.ImageUrl     = voteDataStrategy.GetImageUrl(employee.Account);
        // ToDo: Текущие и максимальные голоса
        employee.SelectedLanguage = voteDataStrategy.GetSelectedLanguage(employee.Account);
        return(employee);
    }