示例#1
0
        /// <summary>
        /// 列表上的项删除事件
        /// </summary>
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton btnRemove = (LinkButton)sender;

                if (btnRemove != null && !String.IsNullOrEmpty(btnRemove.CommandArgument))
                {
                    DNNGo_PowerForms_Field Field = DNNGo_PowerForms_Field.FindByKeyForEdit(btnRemove.CommandArgument);

                    if (Field != null && Field.ID > 0)
                    {
                        mTips.IsPostBack = true;
                        if (Field.Delete() > 0)
                        {
                            //操作成功
                            mTips.LoadMessage("DeleteFieldSuccess", EnumTips.Success, this, new String[] { Field.Alias });
                        }
                        else
                        {
                            //操作失败
                            mTips.LoadMessage("DeleteFieldError", EnumTips.Success, this, new String[] { Field.Alias });
                        }

                        BindDataList();
                    }
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
        protected void cmdDelete_Click(object sender, EventArgs e)
        {
            try
            {
                //查出相关的信息,然后修改状态
                DNNGo_PowerForms_Field ExtendFieldItem = DNNGo_PowerForms_Field.FindByKeyForEdit(FieldID);
                if (ExtendFieldItem != null && ExtendFieldItem.ID > 0)
                {
                    if (ExtendFieldItem.Delete() > 0)
                    {
                        //字段删除成功
                        mTips.LoadMessage("DeleteFieldSuccess", EnumTips.Success, this, new String[] { ExtendFieldItem.Name });
                    }
                    else
                    {
                        //字段删除失败
                        mTips.LoadMessage("DeleteFieldError", EnumTips.Error, this, new String[] { ExtendFieldItem.Name });
                    }
                }



                Response.Redirect(xUrl("FieldList"));
            }
            catch (Exception ex)
            {
                DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
            }
        }