コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id;

            if (int.TryParse(this.Request.QueryString["nodeid"], out id))
            {
                NodeManager nodeManager = new NodeManager("EFConnectionString");
                NodeEntity node = nodeManager.Get(id);
                StringDictionary roles = (this.Master as AdminLayout).UserRoles;

                if (!nodeManager.CheckNodeRole(node, roles, ActionType.ManageNode))
                {
                    this.Response.Write("<script>alert('无权限!');</script>");
                    this.Response.Write("<script>window.location = 'info_manager.aspx';</script>");
                    return;
                }

                int infoCount;

                if (node.ApplicationId == 3)
                {
                    InfoManager infoManager = new InfoManager("EFConnectionString");
                    this.infosView.DataSource = infoManager.GetByNodeId(id, true, int.Parse(this.pageIndex.Value), int.Parse(this.pageSize.Value), out infoCount);
                }
                else
                {
                    infoCount = 0;
                }

                this.infoCount.Value = infoCount.ToString();
                this.infosView.DataBind();
            }
            else if (int.TryParse(this.Request.QueryString["infoid"], out id))
            {
                InfoManager infoManager = new InfoManager("EFConnectionString");
                InfoEntity info = infoManager.Get(id);
                int nodeId = info.NodeId;

                NodeManager nodeManager = new NodeManager("EFConnectionString");
                NodeEntity node = nodeManager.Get(nodeId);

                if (string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings[string.Format(updatePageString, node.ApplicationId.ToString())]))
                {
                    this.Response.Write("<script>alert('配置出错!请联系程序猿!');</script>");
                    this.Response.Write("<script>window.location = 'info_manager.aspx';</script>");
                }
                else
                {
                    this.Response.Redirect(ConfigurationManager.AppSettings[string.Format(updatePageString, node.ApplicationId.ToString())] + "?infoid=" + id);
                }
            }
            else
            {
                this.Response.Write("<script>alert('参数错误!');</script>");
                this.Response.Write("<script>window.location = 'info_manager.aspx';</script>");
            }
        }
コード例 #2
0
ファイル: InfoRepeater.cs プロジェクト: adamchuan/eFramework
 /// <summary>
 /// 获取信息集合。各种具体类型的信息Repeater重载该方法以绑定具体的信息类型。
 /// </summary>
 /// <param name="count">信息总数。</param>
 /// <returns>信息集合。</returns>
 protected virtual List<InfoEntity> GetInfos(out int count)
 {
     InfoManager infoManager = new InfoManager(this.ConnectionStringName);
     return infoManager.GetByNodeId(this.NodeId, false, this.PageIndex, this.PageSize, out count);
 }
コード例 #3
0
        /// <summary>
        /// 获取信息集合。各种具体类型的信息Repeater重载该方法以绑定具体的信息类型。
        /// </summary>
        /// <param name="count">信息总数。</param>
        /// <returns>信息集合。</returns>
        protected virtual List <InfoEntity> GetInfos(out int count)
        {
            InfoManager infoManager = new InfoManager(this.ConnectionStringName);

            return(infoManager.GetByNodeId(this.NodeId, false, this.PageIndex, this.PageSize, out count));
        }
コード例 #4
0
        protected virtual InfoEntity GetInfo(int infoId)
        {
            InfoManager infoManager = new InfoManager(this.connectionStringName.Value);

            return(infoManager.Get(infoId));
        }
コード例 #5
0
ファイル: InfoDetail.cs プロジェクト: adamchuan/eFramework
 protected virtual InfoEntity GetInfo(int infoId)
 {
     InfoManager infoManager = new InfoManager(this.connectionStringName.Value);
     return infoManager.Get(infoId);
 }