Пример #1
0
        public async Task <ServiceContracts> InsertProvider(ServiceContracts serviceContracts)
        {
            serviceContracts.ClientId = (int)_workContext.CurrentCustomer.ClientId;
            serviceContracts          = await _serviceContractRepository.InsertAsync(serviceContracts);

            return(serviceContracts);
        }
        public ProcessServiceContracts()
        {
            ProcessServiceContracts graphServiceContractStatusProcess = null;

            ServiceContracts.SetProcessDelegate(
                delegate(FSServiceContract fsServiceContractRow)
            {
                if (graphServiceContractStatusProcess == null)
                {
                    graphServiceContractStatusProcess = PXGraph.CreateInstance <ProcessServiceContracts>();
                    graphServiceContractStatusProcess.graphServiceContractEntry = PXGraph.CreateInstance <ServiceContractEntry>();
                    graphServiceContractStatusProcess.graphServiceContractEntry.skipStatusSmartPanels = true;
                    graphServiceContractStatusProcess.graphRouteServiceContractEntry = PXGraph.CreateInstance <RouteServiceContractEntry>();
                    graphServiceContractStatusProcess.graphRouteServiceContractEntry.skipStatusSmartPanels = true;
                }

                switch (this.Filter.Current.ActionType)
                {
                case ID.ActionType_ProcessServiceContracts.STATUS:
                    graphServiceContractStatusProcess.processServiceContract(graphServiceContractStatusProcess, fsServiceContractRow);
                    break;

                case ID.ActionType_ProcessServiceContracts.PERIOD:
                    graphServiceContractStatusProcess.ProcessContractPeriod(graphServiceContractStatusProcess, fsServiceContractRow);
                    break;

                default:
                    break;
                }
            });
        }
 public async Task<bool> UpdateServiceContract(ServiceContracts model)
 {
     var entity = await _serviceContractRepository.UpdateAsync(model);
     if (entity != null)
         return true;
     else
         return false;
 }
 public async Task<bool> DeleteServiceContract(ServiceContracts model)
 {
     var result = await _serviceContractRepository.DeleteAsync(model);
     if (result != null)
         return true;
     else
         return false;
 }
Пример #5
0
        /// <summary>
        /// This method contains the core implementation for generating the GeneratedCode
        /// instance.
        /// </summary>
        /// <remarks>
        /// This method decorates every type found in codeNamespace with a CodeTypeMemberExtension.
        /// And then it sends each type through series of ITypeFilters to figure out whether the type
        /// is a service contract, service type, client type, message contract or data contract.
        /// </remarks>
        private void ParseAndFilterCodeNamespace()
        {
            ITypeFilter dataContractTypeFilter    = new DataContractTypeFilter();
            ITypeFilter messageContractTypeFilter = new MessageContractTypeFilter();
            ITypeFilter serviceContractTypeFilter = new ServiceContractTypeFilter();
            ITypeFilter clientTypeTypeFilter      = new ClientTypeTypeFilter();
            ITypeFilter serviceTypeTypeFilter     = new ServiceTypeTypeFilter();

            for (int i = 0; i < codeNamespace.Types.Count; i++)
            {
                // Take a reference to the current CodeTypeDeclaration.
                CodeTypeDeclaration ctd = codeNamespace.Types[i];
                // Create a new instance of CodeTypeMemberExtension to wrap
                // the current CodeTypeDeclaration.
                CodeTypeExtension typeExtension = new CodeTypeExtension(ctd);

                // Also wrap the inner CodeTypeMember(s)
                ExtendTypeMembers(typeExtension);

                // Here we execute the type filters in the highest to lowest probability order.
                if (dataContractTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.DataContract;
                    DataContracts.Add(typeExtension);
                    continue;
                }
                if (messageContractTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.MessageContract;
                    MessageContracts.Add(typeExtension);
                    continue;
                }
                if (serviceContractTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.ServiceContract;
                    ServiceContracts.Add(typeExtension);
                    continue;
                }
                if (clientTypeTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.ClientType;
                    ClientTypes.Add(typeExtension);
                    continue;
                }
                if (serviceTypeTypeFilter.IsMatching(typeExtension))
                {
                    typeExtension.Kind = CodeTypeKind.ServiceType;
                    ServiceTypes.Add(typeExtension);
                    continue;
                }
                UnfilteredTypes.Add(typeExtension);
            }
        }
        public ActivateContractPeriodProcess()
        {
            ActivateContractPeriodProcess graphActivateContractPeriodProcess = null;

            ServiceContracts.SetProcessDelegate(
                delegate(FSServiceContract fsServiceContractRow)
            {
                if (graphActivateContractPeriodProcess == null)
                {
                    graphActivateContractPeriodProcess = PXGraph.CreateInstance <ActivateContractPeriodProcess>();
                    graphActivateContractPeriodProcess.graphServiceContractEntry = PXGraph.CreateInstance <ServiceContractEntry>();
                    graphActivateContractPeriodProcess.graphServiceContractEntry.skipStatusSmartPanels = true;
                    graphActivateContractPeriodProcess.graphRouteServiceContractEntry = PXGraph.CreateInstance <RouteServiceContractEntry>();
                    graphActivateContractPeriodProcess.graphRouteServiceContractEntry.skipStatusSmartPanels = true;
                }

                graphActivateContractPeriodProcess.ProcessContractPeriod(graphActivateContractPeriodProcess, fsServiceContractRow);
            });
        }
Пример #7
0
        public async Task <ServiceContracts> UpdateProvider(ServiceContracts serviceContracts, ProvideModel model)
        {
            serviceContracts.Category = model.Category;
            serviceContracts.Scvendor = model.Scvendor;
            serviceContracts.Scadd1   = model.Scadd1;
            serviceContracts.Scadd2   = model.Scadd2;
            serviceContracts.Sccity   = model.Sccity;
            serviceContracts.Scstate  = model.Scstate;
            serviceContracts.Sczip    = model.Sczip;
            serviceContracts.Scphone1 = model.Scphone1;
            serviceContracts.Scfax    = model.Scfax;

            serviceContracts.AccountNo       = model.AccountNo;
            serviceContracts.ContractNo      = model.ContractNo;
            serviceContracts.ScvendorContact = model.ScvendorContact;
            serviceContracts.SccontactEmail  = model.SccontactEmail;
            serviceContracts.SalesTaxYesNo   = Convert.ToBoolean(model.SalesTaxYesNo);
            serviceContracts.VsalesTax       = model.VsalesTax;

            serviceContracts = await _serviceContractRepository.UpdateAsync(serviceContracts);

            return(serviceContracts);
        }
Пример #8
0
 public void RegisterServiceContract(ServiceContract serviceContract)
 {
     ServiceContracts.Add(serviceContract);
 }
Пример #9
0
 public async Task DeleteProvider(ServiceContracts serviceContracts)
 {
     await _serviceContractRepository.DeleteAsync(serviceContracts);
 }