void lbDelList_Click(object sender, EventArgs e) { try { ListInfo li = new ListInfo(int.Parse(deletedId.Value)); li.Delete(); if (ProjectId < 0) { Response.Redirect("~/Apps/ListApp/Pages/ListInfoList.aspx?Tab=0&ListFolderId=" + _folderId.ToString()); } else { Response.Redirect("~/Projects/ProjectView.aspx?Tab=Lists&ProjectId=" + ProjectId.ToString() + "&ListFolderId=" + ListFolderId.ToString()); } } catch (MetaFieldReferencedException ex) { ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString("N"), String.Format("alert('{0}');", String.Format(CHelper.GetResFileString("{IbnFramework.ListInfo:RefException}"), CHelper.GetResFileString(ListManager.GetListInfoByMetaClassName(ex.MetaClassName).Title))), true); } }
public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { NameValueCollection qs = ((Control)Sender).Page.Request.QueryString; string className = qs["class"]; if (String.IsNullOrEmpty(className)) { className = qs["ClassName"]; } ListInfo li = ListManager.GetListInfoByMetaClassName(className); int folderId = li.FolderId.Value; try { li.Delete(); ((Control)Sender).Page.Response.Redirect("~/Apps/ListApp/Pages/ListInfoList.aspx?ListFolderId=" + folderId.ToString()); } catch (MetaFieldReferencedException ex) { ClientScript.RegisterStartupScript(((Control)Sender).Page, ((Control)Sender).Page.GetType(), Guid.NewGuid().ToString("N"), String.Format("alert('{0}');", String.Format(CHelper.GetResFileString("{IbnFramework.ListInfo:RefException}"), CHelper.GetResFileString(ListManager.GetListInfoByMetaClassName(ex.MetaClassName).Title))), true); } } }