コード例 #1
0
        protected void lbSort_Click(object sender, EventArgs e)
        {
            LinkButton ImgbutSort = (LinkButton)sender;

            if (ImgbutSort != null)
            {
                //查出当前要排序的字段
                DNNGo_DNNGalleryPro_Group objC = DNNGo_DNNGalleryPro_Group.FindByKeyForEdit(ImgbutSort.CommandArgument);

                mTips.IsPostBack = true;//回发时就要触发
                if (ImgbutSort.ToolTip == "up")
                {
                    DNNGo_DNNGalleryPro_Group.MoveField(objC, EnumMoveType.Up, ModuleId);
                    //字段上移成功
                    mTips.LoadMessage("UpMoveGroupSuccess", EnumTips.Success, this, new String[] { "" });
                }
                else
                {
                    DNNGo_DNNGalleryPro_Group.MoveField(objC, EnumMoveType.Down, ModuleId);
                    //字段下移成功

                    mTips.LoadMessage("DownMoveGroupSuccess", EnumTips.Success, this, new String[] { "" });
                }
                //绑定一下
                BindDataList();
            }
        }
コード例 #2
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                DNNGo_DNNGalleryPro_Group item = DNNGo_DNNGalleryPro_Group.FindByKeyForEdit(TagID);
                item.Description = txtContentText.Text;
                item.Name        = txtName.Text;

                if (divOptions.Visible)
                {
                    item.Options = SetItemSettings();
                }



                int Resultitem = 0;

                if (item.ID > 0)
                {
                    Resultitem = item.Update();
                }
                else
                {
                    QueryParam Sqp = new QueryParam();
                    Sqp.ReturnFields = Sqp.Orderfld = DNNGo_DNNGalleryPro_Group._.Sort;
                    Sqp.OrderType    = 1;
                    Sqp.Where.Add(new SearchParam(DNNGo_DNNGalleryPro_Group._.ModuleId, ModuleId, SearchType.Equal));
                    item.Sort = Convert.ToInt32(DNNGo_DNNGalleryPro_Group.FindScalar(Sqp)) + 2;

                    item.ModuleId = ModuleId;
                    item.PortalId = PortalId;
                    Resultitem    = item.Insert();
                }



                if (Resultitem > 0)
                {
                    mTips.LoadMessage("SaveGroupSuccess", EnumTips.Success, this, new String[] { item.Name });
                }
                else
                {
                    //保存失败
                    mTips.LoadMessage("SaveGroupError", EnumTips.Success, this, new String[] { item.Name });
                }
                Response.Redirect(xUrl("Groups"), false);
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
コード例 #3
0
 protected void cmdDeleteCategory_Click(object sender, EventArgs e)
 {
     try
     {
         DNNGo_DNNGalleryPro_Group item = DNNGo_DNNGalleryPro_Group.FindByKeyForEdit(TagID);
         if (item.ID > 0 && item.Delete() > 0)
         {
             mTips.LoadMessage("DeleteGroupSuccess", EnumTips.Success, this, new String[] { item.Name });
         }
         else
         {
             mTips.LoadMessage("DeleteGroupError", EnumTips.Success, this, new String[] { item.Name });
         }
         Response.Redirect(xUrl("Groups"), false);
     }
     catch (Exception ex)
     {
         ProcessModuleLoadException(ex);
     }
 }
コード例 #4
0
        /// <summary>
        /// 状态应用按钮事件
        /// </summary>
        protected void btnApply_Click(object sender, EventArgs e)
        {
            try
            {
                Int32 Status = WebHelper.GetIntParam(Request, ddlStatus.UniqueID, -1);

                if (Status >= 0)
                {
                    string   Checkbox_Value       = WebHelper.GetStringParam(Request, "Checkbox", "");
                    string[] Checkbox_Value_Array = Checkbox_Value.Split(',');
                    Int32    IDX = 0;
                    for (int i = 0; i < Checkbox_Value_Array.Length; i++)
                    {
                        if (Int32.TryParse(Checkbox_Value_Array[i], out IDX))
                        {
                            DNNGo_DNNGalleryPro_Group item = DNNGo_DNNGalleryPro_Group.FindByKeyForEdit(IDX);
                            if (item != null && item.ID > 0)
                            {
                                mTips.IsPostBack = true;
                                if (item.Delete() > 0)
                                {
                                    //mTips.LoadMessage("DeleteCategorySuccess", EnumTips.Success, this, new String[] { item.ContentText });
                                }
                                else
                                {
                                    //mTips.LoadMessage("DeleteCategoryError", EnumTips.Success, this, new String[] { item.ContentText });
                                }
                            }
                        }
                    }
                    BindDataList();
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
コード例 #5
0
        /// <summary>
        /// 列表上的项删除事件
        /// </summary>
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton btnRemove = (LinkButton)sender;

                DNNGo_DNNGalleryPro_Group item = DNNGo_DNNGalleryPro_Group.FindByKeyForEdit(btnRemove.CommandArgument);
                mTips.IsPostBack = true;
                if (item.ID > 0 && item.Delete() > 0)
                {
                    mTips.LoadMessage("DeleteGroupSuccess", EnumTips.Success, this, new String[] { item.Name });
                }
                else
                {
                    mTips.LoadMessage("DeleteGroupError", EnumTips.Success, this, new String[] { item.Name });
                }
                BindDataList();
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
コード例 #6
0
        /// <summary>
        /// 绑定左边项
        /// </summary>
        private void BindDataItem()
        {
            if (TagID > 0)
            {
                cmdDelete.Visible = true;
                cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");

                DNNGo_DNNGalleryPro_Group item = DNNGo_DNNGalleryPro_Group.FindByKeyForEdit(TagID);
                txtName.Text = item.Name;



                txtContentText.Text = item.Description;
            }
            else
            {
                //新增界面
                cmdDelete.Visible = false;
                txtName.Text      = "";

                txtContentText.Text = "";
            }
        }