public static void RedirectToEntity(this PXGraph graph, object row, PXRedirectHelper.WindowMode windowMode) { if (row != null) { PXRedirectHelper.TryRedirect(graph, row, windowMode); } }
public virtual void NavigateToProjectScreen(int?projectID, PXRedirectHelper.WindowMode mode) { var graph = CreateInstance <ProjectEntry>(); graph.Project.Current = graph.Project.Search <PMProject.contractID>(projectID); PXRedirectHelper.TryRedirect(graph, mode); }
private void OpenEntityScreen(IBqlTable entity, PXRedirectHelper.WindowMode windowMode) { if (entity == null) { return; } PXPrimaryGraphCollection primaryGraph = new PXPrimaryGraphCollection(Base); PXRedirectHelper.TryRedirect(primaryGraph[entity], entity, windowMode); }
private void CreateActivity(int classId, Guid?refNoteID, string typeCode, Guid?owner, PXRedirectHelper.WindowMode windowMode = PXRedirectHelper.WindowMode.NewWindow) { var graphType = CRActivityPrimaryGraphAttribute.GetGraphType(classId); if (!PXAccess.VerifyRights(graphType)) { throw new AccessViolationException(CR.Messages.FormNoAccessRightsMessage(graphType)); } CRActivity activity = null; var cache = CreateInstanceCache <CRActivity>(graphType); if (cache == null) { return; } if (owner == null) { owner = EmployeeMaint.GetCurrentEmployeeID(cache.Graph); } Action <object> initializeHandler = delegate(object act1) { var act = act1 as CRActivity; if (act == null) { return; } act.ClassID = classId; act.RefNoteID = refNoteID; if (!string.IsNullOrEmpty(typeCode)) { act.Type = typeCode; } act.OwnerID = owner; }; EntityHelper helper = new EntityHelper(cache.Graph); var type = helper.GetEntityRowType(refNoteID); var entity = helper.GetEntityRow(type, refNoteID); Type entityGraphType = null; if (type != null) { PXPrimaryGraphAttribute.FindPrimaryGraph(cache.Graph.Caches[type], ref entity, out entityGraphType); } if (entityGraphType != null) { PXGraph entry = PXGraph.CreateInstance(entityGraphType); PXCache <CRActivity> activityCache = entry.Caches[typeof(CRActivity)] as PXCache <CRActivity>; if (activityCache != null) { entry.Views[entry.PrimaryView].Cache.Current = entity; activity = (CRActivity)activityCache.CreateInstance(); if (initializeHandler != null) { initializeHandler(activity); } activity = activityCache.InitNewRow(activity); } } if (activity == null) { activity = (CRActivity)cache.CreateInstance(); initializeHandler(activity); activity = ((PXCache <CRActivity>)cache).InitNewRow(activity); } cache.Update(activity); PXRedirectHelper.TryRedirect(cache.Graph, windowMode); }
public virtual void CreateActivity(object refNoteID, string typeCode, Guid?owner, PXRedirectHelper.WindowMode windowMode = PXRedirectHelper.WindowMode.NewWindow) { CreateActivity(CRActivityClass.Activity, (Guid?)refNoteID, typeCode, owner, windowMode); }
public virtual void CreateActivity(object refNoteID, string typeCode, PXRedirectHelper.WindowMode windowMode = PXRedirectHelper.WindowMode.NewWindow) { CreateActivity(refNoteID, typeCode, null, windowMode); }