Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WelfareConfig ent = null;

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

            default:
                if (RequestActionString == "batchdelete")
                {
                    DoBatchDelete();
                }
                else if (RequestActionString == "batchsave")
                {
                    btnSave();
                }
                else if (RequestActionString == "SaveItem")
                {
                    SaveItem();
                }
                else if (RequestActionString == "GetID")
                {
                    //string strGUID = System.Guid.NewGuid().ToString();
                    //string sql = " select * from FL_Culture..WelfareConfig where Id='" + strGUID + "'";
                    //DataTable dt = DataHelper.QueryDataTable(sql);
                    //while (dt.Rows.Count != 0)
                    //{
                    //    strGUID = System.Guid.NewGuid().ToString();
                    //    sql = " select * from FL_Culture..WelfareConfig where Id='" + strGUID + "'";
                    //    dt = DataHelper.QueryDataTable(sql);
                    //}
                    WelfareConfig Ent = new WelfareConfig();
                    Ent.Create();
                    this.PageState.Add("thisid", Ent.Id);
                }
                else if (RequestActionString == "ISEnable")
                {
                    string ISEnable = RequestData.Get <string>("Enable");
                    string ID       = RequestData.Get <string>("ID");
                    string sql      = " update  FL_Culture..WelfareConfig set ISEnable='" + ISEnable + "' where Id in(" + ID + ")";
                    DataHelper.ExecSql(sql);
                }
                else
                {
                    DoSelect();
                }
                break;
            }
        }
Exemplo n.º 2
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");

            WelfareConfig ent = null;

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

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

                ent.DoCreate();
                this.SetMessage("新建成功!");
                break;

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

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

                this.SetFormData(ent);
            }
        }