Example #1
0
 protected void gvSpecialType_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "update")
     {
         string id = e.CommandArgument.ToString();
         if (iType.Value.ToString() == "0")
         {
             Response.Redirect("Dictionary_new.aspx?action=update&Id=" + id + "&type=FirstOrBusinessBunkDescription");
         }
         else
         {
             Response.Redirect("Dictionary_new.aspx?Id=" + id + "&action=update&type=" + iType.Value.ToString());
         }
     }
     else if (e.CommandName == "dictionaryDel")
     {
         if (e.CommandArgument != null)
         {
             string type = string.Empty;
             if (iType.Value.ToString() == "0")
             {
                 type = "FirstOrBusinessBunkDescription";
             }
             else
             {
                 type = iType.Value.ToString();
             }
             try
             {
                 SystemDictionaryType systemDictionaryType = (SystemDictionaryType)Enum.Parse(typeof(SystemDictionaryType), type);
                 SystemDictionaryService.DeleteItem(systemDictionaryType, new Guid(e.CommandArgument.ToString()), "");
                 RegisterScript("alert('删除成功!'); window.location.href='Dictionary.aspx';");
             } catch (Exception ex) {
                 ShowExceptionMessage(ex, "删除");
             }
         }
     }
 }