protected virtual void EPCompanyTreeMaster_Description_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            if (String.IsNullOrEmpty((string)e.NewValue))
            {
                e.NewValue = Messages.EmptyData;
            }

            foreach (EPCompanyTreeMaster item in PXSelect
                     <EPCompanyTreeMaster, Where <EPCompanyTreeMaster.description, Equal <Required <EPCompanyTreeMaster.description> > > > .
                     Select(this, e.NewValue))
            {
                if (item != null && (item.Description == PX.Objects.CR.Messages.New || item.Description == Messages.EmptyData))
                {
                    throw new PXSetPropertyException(Messages.DublicateEmptyData, "Description");
                }
                if (item != null && item.Description == e.NewValue.ToString())
                {
                    throw new PXSetPropertyException(ErrorMessages.DuplicateEntryAdded, "Description");
                }
            }
        }
        protected virtual void KCPaymentMethodsMapping_CAPaymentMethodID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            if (e.NewValue == null)
            {
                return;
            }

            if (VerifyPaymentMethods(e.NewValue.ToString()))
            {
                sender.RaiseExceptionHandling <KCPaymentMethodsMapping.cAPaymentMethodID>(e.Row, null, new Exception(KCMessages.PaymentMethodMoreThanOnce));
                throw new PXException(KCMessages.PaymentMethodMoreThanOnce);
            }
        }
        protected virtual void CCProcessingCenter_ProcessingTypeName_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
        {
            CCProcessingCenter row = e.Row as CCProcessingCenter;

            if (row == null)
            {
                return;
            }
            if (row.ProcessingTypeName != null)
            {
                if (ProcessingCenter.Ask(Messages.ResetDetailsToDefault, MessageButtons.OKCancel) == WebDialogResult.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
            }
        }
예제 #4
0
 protected virtual void LandedCostCode_VendorLocationID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     if (doCancel)
     {
         e.NewValue = ((LandedCostCode)e.Row).VendorLocationID;
         e.Cancel   = true;
         doCancel   = false;
     }
 }
예제 #5
0
 protected virtual void FADepreciationMethod_DisplayTotalPercents_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     if ((decimal?)e.NewValue > 100m && !e.ExternalCall)
     {
         throw new PXSetPropertyException(CS.Messages.Entry_LE, 100);
     }
 }
예제 #6
0
 protected virtual void EPAssignmentMap_EntityType_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     if (e.NewValue != null)
     {
         Type type = GraphHelper.GetType((string)e.NewValue);
         if (type == null)
         {
             throw new PXSetPropertyException(Messages.AssigmentMapEntityType, PXErrorLevel.Error);
         }
     }
 }
 protected virtual void PaymentMethodAccount_PaymentMethodID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }
 protected virtual void BranchAcctMapFrom_ToAccountCD_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }
        protected virtual void INItemSite_DfltShipLocationID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            INItemSite is_row = (INItemSite)e.Row;

            INLocation l = PXSelect <INLocation, Where <INLocation.locationID, Equal <Required <INLocation.locationID> > > > .Select(this, e.NewValue);

            if (l == null)
            {
                return;
            }
            if (!(l.SalesValid ?? true))
            {
                if (itemsiterecord.Ask(AP.Messages.Warning, Messages.IssuesAreNotAllowedFromThisLocationContinue, MessageButtons.YesNo, false) == WebDialogResult.No)
                {
                    e.NewValue = is_row.DfltShipLocationID;
                    e.Cancel   = true;
                }
            }
        }
        protected virtual void RefreshFilter_CuryEffDate_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            DateTime?newValue = (DateTime?)e.NewValue;

            if (!newValue.HasValue || GetUtcSyncDate(newValue.Value) > DateTime.Now.ToUniversalTime().Date)
            {
                throw new PXSetPropertyException(Messages.CurrencyRateRefreshDateInvalid);
            }
        }
예제 #11
0
        protected virtual void ContractDetail_ContractItemID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            ContractDetail detail = (ContractDetail)e.Row;
            ContractItem   item   = PXSelect <ContractItem, Where <ContractItem.contractItemID, Equal <Required <ContractDetail.contractItemID> > > > .Select(this, e.NewValue);

            ContractTemplate template = PXSelect <ContractTemplate, Where <ContractTemplate.contractID, Equal <Required <ContractDetail.contractID> > > > .Select(this, detail.ContractID);

            if (item != null && template != null && item.CuryID != template.CuryID)
            {
                e.NewValue = item.ContractItemCD;
                throw new PXSetPropertyException(Messages.ItemHasAnotherCuryID, item.ContractItemCD, item.CuryID, template.CuryID, PXUIFieldAttribute.GetItemName(CurrentTemplate.Cache));
            }
        }
 protected virtual void InventoryTranByAcctEnqFilter_SubCD_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }
 protected virtual void AccountByYearFilter_SubCD_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }
예제 #14
0
 public virtual void INMovementClass_CountsPerYear_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     if (e.NewValue != null)
     {
         if ((((short)e.NewValue) < 0) || (((short)e.NewValue) > 365))
         {
             throw new PXSetPropertyException(string.Format(Messages.ThisValueShouldBeBetweenP0AndP1, 0, 365));
         }
     }
 }
예제 #15
0
        protected virtual void EPExpenseClaimDetails_Selected_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            EPExpenseClaimDetails row = (EPExpenseClaimDetails)e.Row;

            if (row != null && row.RefNbr != null && (bool)e.NewValue == true)
            {
                sender.RaiseExceptionHandling <EPExpenseClaimDetails.selected>(row, e.NewValue, new PXSetPropertyException(Messages.ReceiptIsClaimed, PXErrorLevel.RowWarning));
            }
        }
 protected virtual void DRScheduleDetail_ComponentID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }
예제 #17
0
 public virtual void INPICycle_MaxCountInaccuracyPct_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     if ((((Decimal)e.NewValue) < 0m) || (((Decimal)e.NewValue) > 100m))
     {
         throw new PXSetPropertyException(Messages.PercentageValueShouldBeBetween0And100);
     }
 }
        protected virtual void EPActivityApprove_ProjectID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            EPActivityApprove row = (EPActivityApprove)e.Row;

            if (row == null)
            {
                return;
            }

            if (e.NewValue != null && e.NewValue is int)
            {
                PMProject proj = PXSelect <PMProject> .Search <PMProject.contractID>(sender.Graph, e.NewValue);

                if (proj != null)
                {
                    if (proj.IsCompleted == true)
                    {
                        var ex = new PXSetPropertyException(PM.Messages.ProjectIsCompleted);
                        ex.ErrorValue = proj.ContractCD;
                        throw ex;
                    }
                    if (proj.IsCancelled == true)
                    {
                        var ex = new PXSetPropertyException(PM.Messages.ProjectIsCanceled);
                        ex.ErrorValue = proj.ContractCD;
                        throw ex;
                    }
                    if (proj.Status == Contract.status.Expired)
                    {
                        var ex = new PXSetPropertyException(PM.Messages.ProjectIsSuspended);
                        ex.ErrorValue = proj.ContractCD;
                        throw ex;
                    }
                }
            }
        }
        protected virtual void PaymentMethod_PaymentType_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
        {
            bool found = false;

            foreach (PaymentMethodDetail iDet in this.Details.Select())
            {
                found = true; break;
            }
            if (found)
            {
                WebDialogResult res = this.PaymentMethod.Ask(Messages.AskConfirmation, Messages.PaymentMethodDetailsWillReset, MessageButtons.YesNo);
                if (res != WebDialogResult.Yes)
                {
                    PaymentMethod row = (PaymentMethod)e.Row;
                    e.Cancel   = true;
                    e.NewValue = row.PaymentType;
                }
            }
        }
        protected virtual void EPActivityApprove_ProjectTaskID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            EPActivityApprove row = (EPActivityApprove)e.Row;

            if (row == null)
            {
                return;
            }

            if (e.NewValue != null && e.NewValue is int)
            {
                PMTask task = PXSelect <PMTask> .Search <PMTask.taskID>(sender.Graph, e.NewValue);

                if (task != null)
                {
                    if (task.IsCompleted == true)
                    {
                        var ex = new PXSetPropertyException(PM.Messages.ProjectTaskIsCompleted);
                        ex.ErrorValue = task.TaskCD;
                        throw ex;
                    }
                    if (task.IsCancelled == true)
                    {
                        var ex = new PXSetPropertyException(PM.Messages.ProjectTaskIsCanceled);
                        ex.ErrorValue = task.TaskCD;
                        throw ex;
                    }
                }
            }
        }
        protected virtual void PaymentMethodAccount_CashAccountID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
        {
            int?newCashAccountID = e.NewValue as int?;

            if (newCashAccountID == null)
            {
                return;
            }

            CashAccount cashAccount = PXSelectReadonly <CashAccount, Where <CashAccount.cashAccountID, Equal <Required <CashAccount.cashAccountID> > > > .Select(this, newCashAccountID);

            if (cashAccount != null && cashAccount.Active != true)
            {
                string errorMsg = string.Format(CA.Messages.CashAccountInactive, cashAccount.CashAccountCD);
                cache.RaiseExceptionHandling <PaymentMethodAccount.cashAccountID>(e.Row, cashAccount.CashAccountCD, new PXSetPropertyException(errorMsg, PXErrorLevel.Error));
            }
        }
 protected virtual void GLIntegrityCheckFilter_FinPeriodID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     if (string.IsNullOrEmpty(e.NewValue?.ToString()))
     {
         throw new PXSetPropertyException(Messages.Prefix + ": " + Messages.ProcessingRequireFinPeriodID, "finPeriodID");
     }
 }
예제 #23
0
        protected virtual void FADepreciationMethod_AveragingConvPeriod_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            if (e.NewValue == null)
            {
                e.Cancel = true;
            }
            else
            {
                short newValue = (short)e.NewValue;
                if (newValue < 1)
                {
                    throw new PXSetPropertyException(CS.Messages.Entry_GE, PXErrorLevel.Error, 1);
                }
                switch (Method.Current.AveragingConvention)
                {
                case FAAveragingConvention.HalfPeriod:
                    if (newValue > 12)
                    {
                        throw new PXSetPropertyException(CS.Messages.Entry_LE, PXErrorLevel.Error, 12);
                    }
                    break;

                case FAAveragingConvention.HalfQuarter:
                    if (newValue > 4)
                    {
                        throw new PXSetPropertyException(CS.Messages.Entry_LE, PXErrorLevel.Error, 4);
                    }
                    break;

                case FAAveragingConvention.HalfYear:
                    if (newValue > 2)
                    {
                        throw new PXSetPropertyException(CS.Messages.Entry_LE, PXErrorLevel.Error, 2);
                    }
                    break;
                }
            }
        }
예제 #24
0
        protected virtual void CRCaseClass_DefaultContractID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            if (e.NewValue == null)
            {
                return;
            }

            Contract contract = PXSelectReadonly <Contract,
                                                  Where <Contract.contractID, Equal <Required <CRCase.contractID> > > > .
                                Select(this, e.NewValue);

            if (contract != null)
            {
                int daysLeft;
                if (ContractMaint.IsExpired(contract, (DateTime)Accessinfo.BusinessDate))
                {
                    e.NewValue = null;
                    throw new PXSetPropertyException(Messages.ContractExpired, PXErrorLevel.Error);
                }
                if (ContractMaint.IsInGracePeriod(contract, (DateTime)Accessinfo.BusinessDate, out daysLeft))
                {
                    e.NewValue = contract.ContractCD;
                    throw new PXSetPropertyException(Messages.ContractInGracePeriod, PXErrorLevel.Warning, daysLeft);
                }
            }
        }
예제 #25
0
 protected virtual void FADepreciationMethodLines_DisplayRatioPerYear_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
     if ((decimal?)e.NewValue < 0m)
     {
         throw new PXSetPropertyException(CS.Messages.Entry_GE, 0.ToString());
     }
     if ((decimal?)e.NewValue > 100m)
     {
         throw new PXSetPropertyException(CS.Messages.Entry_LE, 100.ToString());
     }
 }
예제 #26
0
        protected virtual void CRCaseClass_PerItemBilling_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            CRCaseClass row = e.Row as CRCaseClass;

            if (row == null)
            {
                return;
            }

            CRCase crCase = PXSelect <CRCase, Where <CRCase.caseClassID, Equal <Required <CRCaseClass.caseClassID> >,
                                                     And <CRCase.isBillable, Equal <True>,
                                                          And <CRCase.released, Equal <False> > > > > .SelectWindowed(this, 0, 1, row.CaseClassID);

            if (crCase != null)
            {
                throw new PXSetPropertyException(Messages.CurrentClassHasUnreleasedRelatedCases, PXErrorLevel.Error);
            }
        }
        protected virtual void CCProcessingCenterDetail_Value_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            if (isExportingSettings)
            {
                return;
            }

            CCProcessingCenter       processingCenter = ProcessingCenter.Current;
            CCProcessingCenterDetail procCenterDetail = (CCProcessingCenterDetail)e.Row;

            //skip validation for special values - plugins don't know about this detail ids
            if (!InterfaceConstants.SpecialDetailIDs.Contains(procCenterDetail.DetailID))
            {
                var             graph   = PXGraph.CreateInstance <CCPaymentProcessingGraph>();
                ISettingsDetail idetail = new procDetail()
                {
                    DetailID = procCenterDetail.DetailID, Value = (string)e.NewValue
                };
                graph.ValidateSettings(this, processingCenter.ProcessingCenterID, idetail);
            }
        }
 public override void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
 {
 }
 public virtual void InventoryTranSumEnqFilter_InventoryCD_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }
예제 #30
0
 protected virtual void GLAllocationDestination_BasisSubCD_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
 {
     e.Cancel = true;
 }