/// <summary>
 /// 初始化查询列表
 /// </summary>
 public void BindGrid()
 {
     try
     {
         ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectType voteSubjectType = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.VoteModule.NHibernateDAL.VoteSubjectType)) as ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectType;
         gvList.DataSource = voteSubjectType.GetObjects(base.Where, base.OrderNo);
         gvList.DataBind();
     }
     catch (Exception ex)
     {
         ShowMessage(ex);
     }
 }
示例#2
0
        /// <summary>
        /// 初始化添加/编辑表单
        /// </summary>
        public void Initialize()
        {
            btnAdd.Visible  = false;
            btnEdit.Visible = false;
            btnDel.Visible  = false;

            try
            {
                ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectType          voteSubjectType     = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.VoteModule.NHibernateDAL.VoteSubjectType)) as ZhuJi.Modules.VoteModule.IDAL.IVoteSubjectType;
                IList <ZhuJi.Modules.VoteModule.Domain.VoteSubjectType> listVoteSubjectType = voteSubjectType.GetObjects(string.Empty, "tmp.OrderBy Asc");
                foreach (ZhuJi.Modules.VoteModule.Domain.VoteSubjectType domainVoteSubjectType in listVoteSubjectType)
                {
                    VoteType.Items.Add(new ListItem(domainVoteSubjectType.Text.ToString(), domainVoteSubjectType.Id.ToString()));
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }

            switch (_command)
            {
            case "ADD":
                Add();
                break;

            case "EDIT":
                Edit();
                break;
            }
        }