Beispiel #1
0
        protected virtual void CRCase_SDEnabled_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            CRCase    crCaseRow    = (CRCase)e.Row;
            FSxCRCase fsxCRCaseRow = cache.GetExtension <FSxCRCase>(crCaseRow);

            if (fsxCRCaseRow.SDEnabled == true)
            {
                FSSetup fsSetupRow = GetFSSetup();

                if (fsSetupRow != null &&
                    fsSetupRow.DfltCasesSrvOrdType != null)
                {
                    fsxCRCaseRow.SrvOrdType = fsSetupRow.DfltCasesSrvOrdType;
                }

                SetBranchLocationID(Base, fsxCRCaseRow);
            }
            else
            {
                fsxCRCaseRow.SrvOrdType       = null;
                fsxCRCaseRow.BranchLocationID = null;
            }
        }
Beispiel #2
0
        private void SetPersistingChecks(
            PXCache cache,
            CRCase crCaseRow,
            FSxCRCase fsxCRCaseRow,
            FSSrvOrdType fsSrvOrdTypeRow)
        {
            if (fsxCRCaseRow.SDEnabled == true)
            {
                PXDefaultAttribute.SetPersistingCheck <FSxCRCase.srvOrdType>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);
                PXDefaultAttribute.SetPersistingCheck <FSxCRCase.branchLocationID>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);

                if (fsSrvOrdTypeRow == null)
                {
                    fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsxCRCaseRow.SrvOrdType);
                }

                if (fsSrvOrdTypeRow != null &&
                    fsSrvOrdTypeRow.Behavior != ID.Behavior_SrvOrderType.INTERNAL_APPOINTMENT)
                {
                    PXDefaultAttribute.SetPersistingCheck <CROpportunity.bAccountID>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);
                    if (PXAccess.FeatureInstalled <FeaturesSet.accountLocations>() == true)
                    {
                        PXDefaultAttribute.SetPersistingCheck <CROpportunity.locationID>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);
                    }
                }
            }
            else
            {
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.srvOrdType>(cache, crCaseRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.branchLocationID>(cache, crCaseRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <CROpportunity.bAccountID>(cache, crCaseRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <CROpportunity.locationID>(cache, crCaseRow, PXPersistingCheck.Nothing);
            }
        }
Beispiel #3
0
        private void EnableDisableCustomFields(
            PXCache cache,
            CRCase crCaseRow,
            FSxCRCase fsxCRCaseRow,
            FSServiceOrder fsServiceOrderRow,
            FSSrvOrdType fsSrvOrdTypeRow)
        {
            bool isSMSetup = GetFSSetup() != null;

            if (fsSrvOrdTypeRow != null)
            {
                bool isAnInternalSrvOrdType = fsSrvOrdTypeRow.Behavior == ID.Behavior_SrvOrderType.INTERNAL_APPOINTMENT;

                PXUIFieldAttribute.SetEnabled <CRCase.customerID>(
                    cache,
                    null,
                    isAnInternalSrvOrdType ||
                    (!isAnInternalSrvOrdType && fsServiceOrderRow == null));
            }
            else
            {
                PXUIFieldAttribute.SetEnabled <CRCase.customerID>(
                    cache,
                    null,
                    true);
            }
        }
        public virtual void EnableDisableActions(PXCache cache,
                                                 CRCase crCaseRow,
                                                 FSxCRCase fsxCRCaseRow,
                                                 FSServiceOrder fsServiceOrderRow,
                                                 FSSrvOrdType fsSrvOrdTypeRow)
        {
            bool isSMSetup = GetFSSetup() != null;

            CreateServiceOrder.SetEnabled(isSMSetup && crCaseRow != null && !string.IsNullOrWhiteSpace(crCaseRow.CaseCD) && fsServiceOrderRow == null);
            ViewServiceOrder.SetEnabled(isSMSetup && crCaseRow != null && !string.IsNullOrWhiteSpace(crCaseRow.CaseCD) && fsServiceOrderRow != null);
            OpenAppointmentBoard.SetEnabled(fsServiceOrderRow != null);
        }
Beispiel #5
0
        private void EnableDisableActions(
            PXCache cache,
            CRCase crCaseRow,
            FSxCRCase fsxCRCaseRow,
            FSServiceOrder fsServiceOrderRow,
            FSSrvOrdType fsSrvOrdTypeRow)
        {
            bool isSMSetup = GetFSSetup() != null;

            CreateServiceOrder.SetEnabled(isSMSetup && crCaseRow != null && crCaseRow.CaseID > 0 && fsServiceOrderRow == null);
            ViewServiceOrder.SetEnabled(isSMSetup && crCaseRow != null && crCaseRow.CaseID > 0 && fsServiceOrderRow != null);
            OpenAppointmentBoard.SetEnabled(fsServiceOrderRow != null);
        }
Beispiel #6
0
        public virtual void createServiceOrder()
        {
            CRCase    crCaseRow    = Base.Case.Current;
            FSxCRCase fsxCRCaseRow = Base.Case.Cache.GetExtension <FSxCRCase>(crCaseRow);

            if (CreateServiceOrderFilter.AskExt() == WebDialogResult.OK)
            {
                fsxCRCaseRow.SDEnabled        = true;
                fsxCRCaseRow.BranchLocationID = CreateServiceOrderFilter.Current.BranchLocationID;
                fsxCRCaseRow.SrvOrdType       = CreateServiceOrderFilter.Current.SrvOrdType;
                fsxCRCaseRow.AssignedEmpID    = CreateServiceOrderFilter.Current.AssignedEmpID;
                fsxCRCaseRow.ProblemID        = CreateServiceOrderFilter.Current.ProblemID;

                PXLongOperation.StartOperation(Base, delegate()
                {
                    CreateServiceOrderDocument(Base, crCaseRow, CreateServiceOrderFilter.Current);
                });
            }
        }
Beispiel #7
0
        public virtual void viewServiceOrder()
        {
            if (Base.Case == null || Base.Case.Current == null)
            {
                return;
            }

            if (Base.IsDirty)
            {
                Base.Save.Press();
            }

            FSxCRCase fsxCRCaseRow = Base.Case.Cache.GetExtension <FSxCRCase>(Base.Case.Current);

            if (fsxCRCaseRow != null && fsxCRCaseRow.SOID != null)
            {
                CRExtensionHelper.LaunchServiceOrderScreen(Base, fsxCRCaseRow.SOID);
            }
        }
Beispiel #8
0
        public virtual void openAppointmentBoard()
        {
            if (Base.Case == null || Base.Case.Current == null)
            {
                return;
            }

            if (Base.IsDirty)
            {
                Base.Save.Press();
            }

            FSxCRCase fsxCRCaseRow = Base.Case.Cache.GetExtension <FSxCRCase>(Base.Case.Current);

            if (fsxCRCaseRow != null && fsxCRCaseRow.SOID != null)
            {
                CRExtensionHelper.LaunchEmployeeBoard(Base, fsxCRCaseRow.SOID);
            }
        }
        protected virtual void GetCallerEntity(Guid?refNoteID)
        {
            if (refNoteID != null)
            {
                CRCase crCaseRow = PXSelect <CRCase,
                                             Where <
                                                 CRCase.noteID, Equal <Required <CRCase.noteID> > > >
                                   .Select(Base, refNoteID);

                if (crCaseRow != null)
                {
                    FSxCRCase fsxCRCaseRow = PXCache <CRCase> .GetExtension <FSxCRCase>(crCaseRow);

                    if (fsxCRCaseRow != null && fsxCRCaseRow.SDEnabled == false)
                    {
                        _disableServiceID = false;
                    }

                    _callerEntity = typeof(CRCase);
                }
                else
                {
                    CROpportunity crOpportuniyRow = PXSelect <CROpportunity,
                                                              Where <
                                                                  CROpportunity.noteID, Equal <Required <CROpportunity.noteID> > > >
                                                    .Select(Base, refNoteID);

                    if (crOpportuniyRow != null)
                    {
                        FSxCROpportunity fsxCROpportunityRow = PXCache <CROpportunity> .GetExtension <FSxCROpportunity>(crOpportuniyRow);

                        if (fsxCROpportunityRow != null && fsxCROpportunityRow.SDEnabled == true)
                        {
                            _disableServiceID = false;
                        }

                        _callerEntity = typeof(CROpportunity);
                    }
                }
            }
        }
Beispiel #10
0
        private void SetBranchLocationID(PXGraph graph, FSxCRCase fsxCaseRow)
        {
            UserPreferences userPreferencesRow =
                PXSelect <UserPreferences,
                          Where <
                              UserPreferences.userID, Equal <CurrentValue <AccessInfo.userID> > > > .Select(graph);

            if (userPreferencesRow != null)
            {
                FSxUserPreferences fsxUserPreferencesRow = PXCache <UserPreferences> .GetExtension <FSxUserPreferences>(userPreferencesRow);

                if (fsxUserPreferencesRow != null)
                {
                    fsxCaseRow.BranchLocationID = fsxUserPreferencesRow.DfltBranchLocationID;
                }
            }
            else
            {
                fsxCaseRow.BranchLocationID = null;
            }
        }
Beispiel #11
0
        protected void CRCase_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            CRCase    crCaseRow    = (CRCase)e.Row;
            FSxCRCase fsxCRCaseRow = cache.GetExtension <FSxCRCase>(crCaseRow);

            FSServiceOrder fsServiceOrderRow = CRExtensionHelper.GetRelatedServiceOrder(Base, cache, crCaseRow, fsxCRCaseRow.SOID);
            FSSrvOrdType   fsSrvOrdTypeRow   = null;

            if (fsServiceOrderRow != null)
            {
                fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsServiceOrderRow.SrvOrdType);
            }

            EnableDisableCustomFields(cache, crCaseRow, fsxCRCaseRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            EnableDisableActions(cache, crCaseRow, fsxCRCaseRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            SetPersistingChecks(cache, crCaseRow, fsxCRCaseRow, fsSrvOrdTypeRow);
        }
 private static bool IsTheRequiredFieldsPresent(PXGraph graph, CRCase crCaseRow, FSxCRCase fsxCRCaseRow)
 {
     return(!(crCaseRow == null ||
              fsxCRCaseRow == null ||
              crCaseRow.ClassID == null ||
              crCaseRow.CustomerID == null ||
              crCaseRow.Subject == null ||
              fsxCRCaseRow.SrvOrdType == null ||
              fsxCRCaseRow.BranchLocationID == null));
 }