Пример #1
0
    /// <summary>
    /// 数据绑定体检登记
    /// </summary>
    public override void DataBind()
    {
        int      RecordCount = 0;
        DateTime StartDate   = DateTime.Now.Date;
        DateTime EndDate     = StartDate.AddDays(-7);

        if (!String.IsNullOrWhiteSpace(txtStartDate.Text))
        {
            StartDate = EnvConverter.ToDateTime(txtStartDate.Text).Value;
        }
        if (!String.IsNullOrWhiteSpace(txtEndDate.Text))
        {
            EndDate = EnvConverter.ToDateTime(txtEndDate.Text).Value;
        }
        String DeptName   = txtsDeptName.Text.Trim();
        String RegisterNo = txtsRegisterNo.Text.Trim();
        String Category   = Request.Params["Category"];

        if ((!String.IsNullOrWhiteSpace(Category)) && (Category == "2"))
        {
            RegistrationRepeater.DataSource = m_Registration.GetGroupRegistrations(Pager.CurrentPageIndex,
                                                                                   Pager.PageSize, StartDate, EndDate, DeptName, out RecordCount);
        }
        if ((String.IsNullOrWhiteSpace(Category)) || (Category != "2"))
        {
            RegistrationRepeater.DataSource = m_Registration.GetIndividualRegistrations(
                Pager.CurrentPageIndex, Pager.PageSize, StartDate, EndDate, RegisterNo, out RecordCount);
        }
        Pager.RecordCount = RecordCount;
        base.DataBind();
    }