コード例 #1
0
        protected void rpGroups_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Vote.Model.VoteItemGroup gmodel = e.Item.DataItem as Vote.Model.VoteItemGroup;
                Vote.BLL.VoteItem ibll = new NoName.NetShop.Vote.BLL.VoteItem();

                GridView gvItems = e.Item.FindControl("gvItems") as GridView;
                gvItems.DataSource = ibll.GetItemsOfGroup(gmodel.ItemGroupId);
                gvItems.DataBind();
            }
        }
コード例 #2
0
        protected void rpList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            NetShop.Vote.BLL.VoteItem ibll = new NoName.NetShop.Vote.BLL.VoteItem();
            NetShop.Vote.Model.VoteItemGroup gmodel = e.Item.DataItem as NetShop.Vote.Model.VoteItemGroup;
            Repeater rpItem = e.Item.FindControl("rpItem") as Repeater;

            List<NetShop.Vote.Model.VoteItem> list = ibll.GetItemsOfGroup(gmodel.ItemGroupId);
            foreach (NetShop.Vote.Model.VoteItem item in list)
            {
                item.VoteTotalCount = vmodel.VoteUserNum;
            }
            rpItem.DataSource = list;
            rpItem.DataBind();
        }
コード例 #3
0
 private void ShowInfo(int voteId)
 {
     Vote.BLL.VoteTopic vbll = new NoName.NetShop.Vote.BLL.VoteTopic();
     Vote.BLL.VoteItemGroup gbll = new NoName.NetShop.Vote.BLL.VoteItemGroup();
     Vote.BLL.VoteItem ibll = new NoName.NetShop.Vote.BLL.VoteItem();
     Vote.Model.VoteTopic vmodel = vbll.GetModel(voteId);
     if (vmodel != null)
     {
         this.lblEndDate.Text = vmodel.EndTime == null ? "" : (vmodel.EndTime ?? DateTime.MaxValue).ToShortDateString();
         this.lblStartDate.Text = vmodel.StartTime == null ? "" : (vmodel.StartTime ?? DateTime.MaxValue).ToShortDateString();
         this.chkIsMulti.Checked = vmodel.IsMulti;
         this.chkIsRegUser.Checked = vmodel.IsRegUser;
         this.chkStatus.Checked = vmodel.Status;
         this.lblRemark.Text = vmodel.Remark;
         this.lblTopic.Text = vmodel.Topic;
         this.lblVoteId.Text = vmodel.VoteId.ToString();
         this.lblVoteUserNum.Text = vmodel.VoteUserNum.ToString();
     }
     rpGroups.DataSource = gbll.GetModelList(voteId);
     rpGroups.DataBind();
 }