예제 #1
0
    protected void btnSelectDate_Click(object sender, EventArgs e)
    {
        radAppointment.SelectedDate = selDate.DateTime.Value;

        if (txtEmployee.Text.ToUpper() == "TODOS")
        {
            txtEmployee.Text       = "Todos";
            radAppointment.GroupBy = "UserName";
        }
        else
        {
            string[] cpf = txtEmployee.Text.Split(new[] { " | " }, StringSplitOptions.None);

            if (cpf.Count() == 2)
            {
                employee = manager.RetrieveEmployeeByCpf(Company.CompanyId, cpf[0]);

                if (employee != null && employee.Profile.CPF != "")
                {
                    Page.ViewState["userId"]     = manager.GetUserByEmployee(employee.EmployeeId).UserId;
                    Page.ViewState["EmployeeId"] = employee.EmployeeId;
                }
                else
                {
                    EmployeeNotFound();
                }
            }
            else
            {
                EmployeeNotFound();
            }
        }
    }
예제 #2
0
    protected void txtEmployee_TextChanged(object sender, EventArgs e)
    {
        onSelectingEmployee(this, new SelectingEmployeeEventArgs
        {
            EmployeeName = txtEmployee.Text
        });

        if (txtEmployee.Text.Contains("|"))
        {
            string identification = txtEmployee.Text.Split('|')[0].Trim();

            _employee = _humanResourcesManager.RetrieveEmployeeByCpf(Page.Company.CompanyId, identification);
            ShowEmployee(_employee);
        }
    }