예제 #1
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     using (PackageBusiness Business = new PackageBusiness()) {
         m_Packages = Business.GetPackages();
     }
 }
예제 #2
0
    /// <summary>
    /// 数据绑定
    /// </summary>
    public override void DataBind()
    {
        int RecordCount = 0;
        List <PackageEntity> DataSource = m_Package.GetPackages(Pager.CurrentPageIndex, Pager.PageSize, out RecordCount);

        PackageRepeater.DataSource = DataSource;
        Pager.RecordCount          = RecordCount;
        base.DataBind();
        if (DataSource.Count > 0)
        {
            BindItemGroup(DataSource[0].PackageID.Value);
        }
    }
예제 #3
0
    public override void DataBind()
    {
        int    RecordCount   = 0;
        int    SelectedIndex = drpCategory.SelectedIndex;
        String SearchKey     = txtName.Text.Trim();
        int    DeptID        = Convert.ToInt32(Request.Params["DeptID"]);

        if (SelectedIndex == 0)
        {
            //团体体检或体检收费

            List <DepartmentGroupViewEntity> DataSource;
            //检索团体体检是否设置了套餐
            using (DepartmentGroupBusiness DeptGroup = new DepartmentGroupBusiness()) {
                DataSource = DeptGroup.GetDepartmentGroups(DeptID);
            }
            //团体客户有体检套餐设置
            if (DataSource.Count > 0)
            {
                PackageRepeater.DataSource = DataSource;
                Pager.RecordCount          = DataSource.Count;
            }
            //团体客户未设置体检套餐
            if (DataSource.Count <= 0)
            {
                using (PackageBusiness Package = new PackageBusiness()) {
                    PackageRepeater.DataSource = Package.GetPackages(Pager.CurrentPageIndex,
                                                                     Pager.PageSize, SearchKey, PackageSex, out RecordCount);;
                    Pager.RecordCount = RecordCount;
                }
            }

            Pager.Visible  = true;
            Pager1.Visible = false;
            Panel.Visible  = false;
        }
        if (SelectedIndex == 1)
        {
            using (ItemGroupBusiness ItemGroup = new ItemGroupBusiness()) {
                ItemGroupRepeater.DataSource = ItemGroup.GetItemGroups(Pager1.CurrentPageIndex, Pager1.PageSize,
                                                                       SearchKey, ItemGroupSex, out RecordCount);
                Pager1.RecordCount = RecordCount;
            }
            Pager.Visible  = false;
            Pager1.Visible = true;
            Panel.Visible  = true;
        }
        base.DataBind();
    }