private void requestSource_Updated(object sender, TpObjectDataSourceEventArgs e) { var request = e.BusinessObject as Request; var uxAttachment = requestDetails.FindControl("uxAttachment") as AttachmentControl; request.AddAttachments(uxAttachment.Attachments); Response.Redirect("~/MyRequests.aspx"); }
private void requestSource_Updated(object sender, TpObjectDataSourceEventArgs e) { var requester = (Requester)e.BusinessObject; ActionProcessor.ReplaceLastAction("You were registered successfully"); LastActionLabel.DoReset = false; FormsAuthentication.RedirectFromLoginPage(requester.ID.ToString(), false); Globals.IsLogOut = false; }
protected void requesterSource_SourceObject(object sender, TpObjectDataSourceEventArgs e) { if (Requester.Logged != null) { e.BusinessObject = Requester.Logged; } else { e.Cancel = true; } }
protected void requestSource_OnSelected(object sender, TpObjectDataSourceEventArgs e) { if (e.BusinessObject != null) { IEnumerator enumerator = ((IEnumerable)e.BusinessObject).GetEnumerator(); if (enumerator.MoveNext()) { var entity = enumerator.Current as Request; //If no entity found using current query and user is logged as Anonymous if (!entity.ID.HasValue && Requester.IsLoggedAsAnonymous) { if (e.SelectParams.Contains("RequestId")) { var requestId = e.SelectParams["RequestId"] as int?; if (requestId != null) { //If such entity exist - redirects to login page for try to access this request if (Hd.Portal.Request.Retrieve(requestId, true) != null) { Globals.IsLogOut = true; FormsAuthentication.RedirectToLoginPage(); //Globals.CurrentQueryString); return; } } } } if (IsNotSavedRequest(entity) || !PermissionManager.HaveRightToViewRequest(entity)) { ActionProcessor.ReplaceLastAction("Request not found"); Response.Redirect(Requester.IsLogged ? "~/MyRequests.aspx" : "~/Default.aspx"); } } } }
protected void OnUpdated(object sender, TpObjectDataSourceEventArgs e) { }