示例#1
0
    private void Show(int vid)
    {
        VoteInfo byId = Vote.Init().GetById(vid);

        this.VoteTitle.Value          = byId.VoteTitle;
        this.VoteContent.Value        = byId.VoteContent;
        this.IsValide.SelectedValue   = string.Concat(byId.IsValide);
        this.IsMultiple.SelectedValue = string.Concat(byId.IsMultiple);
        this.ShowUser.SelectedValue   = string.Concat(byId.ShowUser);
        this.userlist.Value           = byId.userlist;
        this.namelist.Value           = byId.namelist;
        this.ViewState["vi"]          = byId;
    }
示例#2
0
    private void Show(int vid)
    {
        VoteInfo byId = Vote.Init().GetById(vid);

        if (!string.IsNullOrEmpty(byId.VoteContent) && (byId.ShowUser == 1 || this.Modules.Contains("45")))
        {
            this.ds = MsSqlOperate.ExecuteDataset(CommandType.Text, "select * from VoteDetail where VoteID=" + vid, new SqlParameter[0]);
            List <TmpInfo> list = new List <TmpInfo>();
            if (byId.VoteContent.Contains("\n"))
            {
                string[] array = byId.VoteContent.Split(new string[]
                {
                    "\n"
                }, StringSplitOptions.None);
                for (int i = 0; i < array.Length; i++)
                {
                    if (!string.IsNullOrEmpty(array[i].Replace("\n", "").Replace("\r", "")))
                    {
                        list.Add(new TmpInfo
                        {
                            Tmp1 = array[i].Replace("\n", "").Replace("\r", "")
                        });
                    }
                }
            }
            else
            {
                list.Add(new TmpInfo
                {
                    Tmp1 = byId.VoteContent.Replace("\n", "").Replace("\r", "")
                });
            }
            this.rpt.DataSource = list;
            this.rpt.DataBind();
        }
    }