protected void cmdUpdate_Click(object sender, EventArgs e) { try { Playngo_ClientZone_GameCategory item = Playngo_ClientZone_GameCategory.FindByKeyForEdit(CategoryID); item.ContentText = txtContentText.Text; item.Name = txtName.Text; List <KeyValueEntity> list = new List <KeyValueEntity>(); if (divOptions.Visible) { item.Options = SetItemSettings(out list); } item.LastIP = WebHelper.UserHost; item.LastTime = xUserTime.UtcTime(); item.LastUser = UserId; if (item.ID > 0) { } else { QueryParam qp = new QueryParam(); item.Sort = Playngo_ClientZone_GameCategory.FindMaxSort(ModuleId) + 1; item.ModuleId = ModuleId; item.PortalId = PortalId; } int Resultitem = 0; if (item.ID > 0) { Resultitem = item.Update(); } else { Resultitem = item.Insert(); } if (Resultitem > 0) { mTips.LoadMessage("SaveCategorySuccess", EnumTips.Success, this, new String[] { item.Name }); } else { //保存失败 mTips.LoadMessage("SaveCategoryError", EnumTips.Success, this, new String[] { item.Name }); } Response.Redirect(xUrl("GameCategory"), false); } catch (Exception ex) { ProcessModuleLoadException(ex); } }