protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {



            cboPageSize.Items.Add(new ListItem() { Value = Int16.MaxValue.ToString(), Text = "Todos" });
            txtBeginDate.Text = DateTime.Now.Date.AddDays(-30).ToString();
            txtEndDate.Text = DateTime.Now.Date.AddDays(1).ToString();

            //
            // select user in combo if user logged is technical user
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            //if (employee != null)
            //{
            //    if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
            //        cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
            //}


        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ucDateTimeInterval.DateInterval = new DateTimeInterval(DateTime.Now.Date.AddDays(-30), DateTime.Now.Date.AddDays(1));

            cboTechnicalUser.DataBind();

            //
            // select user in combo if user logged is technical user
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            if (employee != null)
            {
                if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
                    cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
            }

            if (Page.Customization["cboCustomerCallType"] != null)
                cboCustomerCallType.SelectedIndex = Convert.ToInt32(Page.Customization["cboCustomerCallType"]);

            if (Page.Customization["cboStatus"] != null)
                cboStatus.SelectedIndex = Convert.ToInt32(Page.Customization["cboStatus"]);

            if (Page.Customization["cboPageSize"] != null)
                cboPageSize.SelectedIndex = Convert.ToInt32(Page.Customization["cboPageSize"]);

            if (Page.Customization["cboTechnicalUser"] != null && cboTechnicalUser.Items.FindByValue(Convert.ToString(Page.Customization["cboTechnicalUser"])) != null)
                cboTechnicalUser.SelectedValue = Convert.ToString(Page.Customization["cboTechnicalUser"]);
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ucDateTimeInterval.DateInterval = new DateTimeInterval(DateTime.Now.Date.AddDays(-30), DateTime.Now.Date.AddDays(1));

            cboTechnicalUser.DataBind();

            //
            // select user in combo if user logged is technical user
            //
            var      humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            if (employee != null)
            {
                if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
                {
                    cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
                }
            }

            if (Page.Customization["cboCustomerCallType"] != null)
            {
                cboCustomerCallType.SelectedIndex = Convert.ToInt32(Page.Customization["cboCustomerCallType"]);
            }

            if (Page.Customization["cboStatus"] != null)
            {
                cboStatus.SelectedIndex = Convert.ToInt32(Page.Customization["cboStatus"]);
            }

            if (Page.Customization["cboPageSize"] != null)
            {
                cboPageSize.SelectedIndex = Convert.ToInt32(Page.Customization["cboPageSize"]);
            }

            if (Page.Customization["cboTechnicalUser"] != null && cboTechnicalUser.Items.FindByValue(Convert.ToString(Page.Customization["cboTechnicalUser"])) != null)
            {
                cboTechnicalUser.SelectedValue = Convert.ToString(Page.Customization["cboTechnicalUser"]);
            }
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            cboPageSize.Items.Add(new ListItem()
            {
                Value = Int16.MaxValue.ToString(), Text = "Todos"
            });
            txtBeginDate.Text = DateTime.Now.Date.AddDays(-30).ToString();
            txtEndDate.Text   = DateTime.Now.Date.AddDays(1).ToString();

            //
            // select user in combo if user logged is technical user
            //
            var      humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            //if (employee != null)
            //{
            //    if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
            //        cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
            //}
        }
    }