protected void Page_Load(object sender, EventArgs e) { if(Request.QueryString["id"] != null) { m_oIARequest = DataAccess.IARequests.SingleOrDefault(row => row.IARequestID == MemberProtect.Utility.ValidateInteger(Request.QueryString["id"])); if (ApplicationContext.IsCustomer) { if (!ApplicationContext.CanCurrentUserViewOrder(m_oIARequest)) { m_oIARequest = null; } } } if(m_oIARequest == null) { Response.Redirect("~/Default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (ApplicationContext.IsStaff) { if (Session["IARequestID"] != null) { m_oIARequest = DataAccess.IARequests.SingleOrDefault(row => row.IARequestID == (int)Session["IARequestID"]); } else { throw new ApplicationException("Request cannot be found."); } if (!Page.IsPostBack) { LoadNotes(); litJSCall.Text = string.Format("$find('{0}').ajaxRequestWithTarget('{1}', 'RefreshNotes');", m_oAjaxPanel.ClientID, m_oAjaxPanel.UniqueID); } } }
protected void Page_Load(object sender, EventArgs e) { if(Request.QueryString["id"] != null) { Session["IARequestID"] = MemberProtect.Utility.ValidateInteger(Request.QueryString["id"]); } if(Session["IARequestID"] != null) { m_oIARequest = DataAccess.IARequests.SingleOrDefault(row => row.IARequestID == (int)Session["IARequestID"]); } if (m_oIARequest != null) { SetBreadCrumb(); // Validate the request can be viewed by the current user if (!ApplicationContext.CanCurrentUserViewOrder(m_oIARequest)) { Response.Redirect("~/Default.aspx"); } // Security passed, now ensure the request being edit is unlocked if(m_oIARequest.IsLocked) { Response.Redirect(string.Format("~/order-details.aspx?rid={0}", m_oIARequest.IARequestID)); } if(!IsPostBack) { LoadCustomerInformation(MemberProtect.CurrentUser.UserID); m_txtScript.Content = m_oIARequest.Script; m_txtProductionNotes.Content = m_oIARequest.ProductionNotes; if(m_oIARequest.IsRushOrder) { m_radSameDay.Checked = true; } else { m_rad24Hour.Checked = true; } if (m_oIARequest.IARequestFiles != null && m_oIARequest.IARequestFiles.Count > 0) { m_oRepeaterFiles.DataSource = m_oIARequest.IARequestFiles; m_oRepeaterFiles.DataBind(); } else { divFilesList.Visible = false; } } } }