string IViewDocumentActionsTask.GetAvailableActions(int documentId, Guid userId, ActionType actionType) { using (XmlReader xr = dao.GetAvailableActions(documentId, userId, ActionMask.Document, actionType)) { if (!xr.Read()) { return(string.Empty); } return(xr.ReadOuterXml()); } }
protected void Page_Load(object sender, EventArgs e) { Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton4"; if (CoreObject.GetId(Request) <= 0) { BaseContentPage.SetError("Sprawa o podanym numerze nie istnieje", "~/Akta/AktaSpraw.aspx"); } if (!IsPostBack) { int caseId = CoreObject.GetId(Request); if (caseId > 0) { if (!Page.User.IsInRole("Administratorzy") && !(new CaseDAO()).IsCaseVisibleForUser(caseId, new Guid(Membership.GetUser().ProviderUserKey.ToString()))) { BaseContentPage.SetError("Nie masz uprawnieñ do tej sprawy", "~/OczekujaceZadania.aspx"); } } ActionDAO dao = new ActionDAO(); string xmlData = string.Empty; try { //using (XmlReader xr = dao.GetAvailableActions(int.Parse(Session["idSprawy"].ToString()), (Guid)Membership.GetUser().ProviderUserKey, ActionMask.Case,ActionType.CalledFromList)) using (XmlReader xr = dao.GetAvailableActions(CoreObject.GetId(Request), (Guid)Membership.GetUser().ProviderUserKey, ActionMask.Case, ActionType.CalledFromList)) { if (xr.Read()) { xmlData = xr.ReadOuterXml(); } } XmlDataSource xds = new XmlDataSource(); xds.Data = xmlData; xds.EnableCaching = false; lista.DataSource = null; if (xds.Data != "") { xds.XPath = "/akcje/akcja"; lista.DataSource = xds; } lista.DataBind(); } catch //(Exception ex) { BaseContentPage.SetError("Nie uda³o siê odnaleŸæ sprawy", "~/Akta/AktaSpraw.aspx"); } } }