public string GetRedirectUrl() { string redirectUrl; if (Helper.Context.Session["ReturnTo"] != null && !string.IsNullOrEmpty(Helper.Context.Session["ReturnTo"].ToString())) { redirectUrl = Helper.Context.Session["ReturnTo"].ToString(); } else { ViewType view = Helper.Context.GetCurrentViewType(); if (view == ViewType.UserView) { redirectUrl = $"~/UserReservations.aspx?Date={Helper.Context.Request.SelectedDate():yyyy-MM-dd}"; } else if (view == ViewType.ProcessTechView) { // When we come from ProcessTech.aspx the full path is used (to avoid a null object error). When returning we just want the ProcessTech path. IProcessTech pt = Helper.GetCurrentProcessTech(); PathInfo path = PathInfo.Create(pt); redirectUrl = $"~/ProcessTech.aspx?Path={path.UrlEncode()}&Date={Helper.Context.Request.SelectedDate():yyyy-MM-dd}"; } else //ViewType.DayView OrElse Scheduler.ViewType.WeekView { redirectUrl = $"~/ResourceDayWeek.aspx?Path={Helper.Context.Request.SelectedPath().UrlEncode()}&Date={Helper.Context.Request.SelectedDate():yyyy-MM-dd}"; } } //_context.Response.Redirect(redirectUrl, false); return(redirectUrl); }
private void SetProcessTechProperties(IProcessTech x, DataRow dr) { SetLabProperties(x, dr); x.ProcessTechID = dr.Field <int>("ProcessTechID"); x.ProcessTechName = dr.Field <string>("ProcessTechName"); x.ProcessTechDescription = dr.Field <string>("ProcessTechDescription"); x.ProcessTechIsActive = dr.Field <bool>("ProcessTechIsActive"); x.ProcessTechGroupID = dr.Field <int>("ProcessTechGroupID"); x.ProcessTechGroupName = dr.Field <string>("ProcessTechGroupName"); }
public static PathInfo Create(IProcessTech pt) { PathInfo result = new PathInfo(); if (pt != null) { result.BuildingID = pt.BuildingID; result.LabID = pt.LabID; result.ProcessTechID = pt.ProcessTechID; } return(result); }
public ResourceTableItem(HttpContextBase context, IBuilding bld, ILab lab, IProcessTech pt, IResource res) { _context = context; BuildingID = bld.BuildingID; LabID = lab.LabID; ProcessTechID = pt.ProcessTechID; ResourceID = res.ResourceID; BuildingName = bld.BuildingName; LabName = lab.LabDisplayName; ProcessTechName = pt.ProcessTechName; ResourceName = res.ResourceName; LabUrl = VirtualPathUtility.ToAbsolute(string.Format("~/Lab.aspx?Path={0}&Date={1:yyyy-MM-dd}", PathInfo.Create(lab), _context.Request.SelectedDate())); ProcessTechUrl = VirtualPathUtility.ToAbsolute(string.Format("~/ProcessTech.aspx?Path={0}&Date={1:yyyy-MM-dd}", PathInfo.Create(pt), _context.Request.SelectedDate())); ResourceUrl = VirtualPathUtility.ToAbsolute(string.Format("~/ResourceDayWeek.aspx?Path={0}&Date={1:yyyy-MM-dd}", PathInfo.Create(res), _context.Request.SelectedDate())); }