예제 #1
0
        string type = String.Empty; // 对象类型

        #endregion

        #region ASP.NET 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");

            SysParameter ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent = this.GetMergedData <SysParameter>();
                ent.DoUpdate();
                this.SetMessage("修改成功!");
                break;

            case RequestActionEnum.Create:
                ent = this.GetPostedData <SysParameter>();

                ent.CreaterID   = UserInfo.UserID;
                ent.CreaterName = UserInfo.Name;
                ent.DoCreate();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysParameter>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                return;
            }

            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = SysParameter.Find(id);
                }

                this.SetFormData(ent);
            }
            else
            {
                PageState.Add("CreaterName", UserInfo.Name);
                PageState.Add("CreatedDate", DateTime.Now);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            cid = RequestData.Get <string>("cid");

            SysParameter ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysParameter>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> idList = RequestData.GetList <object>("IdList");

                if (idList != null && idList.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        SysParameter.DoBatchDelete(idList.ToArray());
                    }
                }
                break;

            default:
                if (!String.IsNullOrEmpty(cid))
                {
                    SearchCriterion.SetOrder("SortIndex");
                    SearchCriterion.SetSearch("CatalogID", cid);

                    ents = SysParameterRule.FindAll(SearchCriterion);
                    this.PageState.Add("SysEnumerationList", ents);
                }
                break;
            }
        }