public virtual void OpenSchedule()
        {
            RouteServiceContractScheduleEntry graphContractScheduleEntry = PXGraph.CreateInstance <RouteServiceContractScheduleEntry>();

            FSRouteContractSchedule fsScheduleRow_Local = (FSRouteContractSchedule)PXSelect <FSRouteContractSchedule,
                                                                                             Where <
                                                                                                 FSRouteContractSchedule.scheduleID, Equal <Required <FSRouteContractSchedule.scheduleID> > > >
                                                          .Select(this, ServiceContracts.Current.ScheduleID);

            graphContractScheduleEntry.ContractScheduleRecords.Current = (FSRouteContractSchedule)fsScheduleRow_Local;
            throw new PXRedirectRequiredException(graphContractScheduleEntry, null)
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }
        public override void openScheduleScreenByGenerationLogError()
        {
            RouteServiceContractScheduleEntry graphContractScheduleEntry = PXGraph.CreateInstance <RouteServiceContractScheduleEntry>();

            FSRouteContractSchedule fsContractScheduleRow = PXSelect <FSRouteContractSchedule,
                                                                      Where <
                                                                          FSRouteContractSchedule.scheduleID, Equal <Required <FSRouteContractSchedule.scheduleID> > > >
                                                            .Select(this, ErrorMessageRecords.Current.ScheduleID);

            graphContractScheduleEntry.ContractScheduleRecords.Current = fsContractScheduleRow;
            throw new PXRedirectRequiredException(graphContractScheduleEntry, null)
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }
        public override void openScheduleScreenBySchedules()
        {
            RouteServiceContractScheduleEntry graphContractScheduleEntry = PXGraph.CreateInstance <RouteServiceContractScheduleEntry>();
            FSRouteContractSchedule           fsContractScheduleRow      =
                PXSelect <FSRouteContractSchedule,
                          Where <
                              FSRouteContractSchedule.refNbr, Equal <Required <FSRouteContractSchedule.refNbr> >,
                              And <FSRouteContractSchedule.entityType, Equal <ListField_Schedule_EntityType.Contract>,
                                   And <FSRouteContractSchedule.entityID, Equal <Required <FSRouteContractSchedule.entityID> >,
                                        And <FSRouteContractSchedule.customerID, Equal <Required <FSRouteContractSchedule.customerID> > > > > > >
                .Select(this, RouteContractSchedules.Current.RefNbr, RouteContractSchedules.Current.EntityID, RouteContractSchedules.Current.CustomerID);

            graphContractScheduleEntry.ContractScheduleRecords.Current = fsContractScheduleRow;
            throw new PXRedirectRequiredException(graphContractScheduleEntry, null)
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }
예제 #4
0
        public override void AddSchedule()
        {
            var graph = PXGraph.CreateInstance <RouteServiceContractScheduleEntry>();

            FSRouteContractSchedule fsContractScheduleRow = new FSRouteContractSchedule()
            {
                EntityID        = ServiceContractRecords.Current.ServiceContractID,
                ScheduleGenType = ServiceContractRecords.Current.ScheduleGenType,
                ProjectID       = ServiceContractRecords.Current.ProjectID
            };

            graph.ContractScheduleRecords.Insert(fsContractScheduleRow);

            throw new PXRedirectRequiredException(graph, null)
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }
예제 #5
0
        protected virtual void openScheduleScreen()
        {
            if (RouteAppointmentForecastingRecords.Current != null)
            {
                RouteServiceContractScheduleEntry graphContractScheduleEntry = PXGraph.CreateInstance <RouteServiceContractScheduleEntry>();

                FSRouteContractSchedule fsContractScheduleRow = PXSelect <FSRouteContractSchedule,
                                                                          Where <
                                                                              FSRouteContractSchedule.scheduleID, Equal <Required <FSRouteContractSchedule.scheduleID> >,
                                                                              And <FSRouteContractSchedule.entityType, Equal <ListField_Schedule_EntityType.Contract>,
                                                                                   And <FSRouteContractSchedule.entityID, Equal <Required <FSRouteContractSchedule.entityID> >,
                                                                                        And <FSRouteContractSchedule.customerID, Equal <Required <FSRouteContractSchedule.customerID> > > > > > >
                                                                .Select(this, RouteAppointmentForecastingRecords.Current.ScheduleID, RouteAppointmentForecastingRecords.Current.ServiceContractID, RouteAppointmentForecastingRecords.Current.CustomerID);

                graphContractScheduleEntry.ContractScheduleRecords.Current = fsContractScheduleRow;
                throw new PXRedirectRequiredException(graphContractScheduleEntry, null)
                      {
                          Mode = PXBaseRedirectException.WindowMode.NewWindow
                      };
            }
        }
예제 #6
0
        /// <summary>
        /// Allows to calculate the <c>RefNbr</c> sequence when trying to insert a new register.
        /// </summary>
        protected override bool SetRefNbr(PXCache cache, object row)
        {
            FSRouteContractSchedule fsRouteContractScheduleRow = (FSRouteContractSchedule)row;

            if (fsRouteContractScheduleRow.EntityID == null)
            {
                return(false);
            }

            FSServiceContract fsServiceContractRow = ServiceContractCore.ServiceContract_View.Select(cache.Graph, fsRouteContractScheduleRow.EntityID);

            if (fsServiceContractRow == null)
            {
                return(false);
            }

            FSRouteContractSchedule fsRouteContractScheduleRow_tmp = PXSelectReadonly <FSRouteContractSchedule,
                                                                                       Where <
                                                                                           FSRouteContractSchedule.entityID, Equal <Current <FSRouteContractSchedule.entityID> >,
                                                                                           And <FSRouteContractSchedule.entityType, Equal <FSRouteContractSchedule.entityType.Contract> > >,
                                                                                       OrderBy <
                                                                                           Desc <FSRouteContractSchedule.scheduleID> > >
                                                                     .SelectWindowed(cache.Graph, 0, 1);

            string refNbr = string.Empty;

            if (fsRouteContractScheduleRow_tmp != null)
            {
                refNbr = fsRouteContractScheduleRow_tmp.RefNbr;
            }

            if (refNbr.LastIndexOf("<NEW>") != -1)
            {
                refNbr = string.Empty;
            }

            fsRouteContractScheduleRow.RefNbr = SharedFunctions.GetNextRefNbr(fsServiceContractRow.RefNbr, refNbr);

            return(true);
        }