Inheritance: MonoBehaviour
コード例 #1
0
        /// <summary>
        /// Ons the get async.
        /// </summary>
        /// <returns>The get async.</returns>
        public async Task <IActionResult> OnPostAsync()
        {
            _logger.LogDebug("Faxes/Create/OnPostAsync");

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var emptyFax = new Fax();

            if (await TryUpdateModelAsync <Fax>(
                    emptyFax,
                    "fax",                     // prefix for value
                    f => f.Number,
                    f => f.SerialNumber,
                    f => f.Pin,
                    f => f.Active,
                    f => f.Replace,
                    f => f.LastUpdate
                    ).ConfigureAwait(false))
            {
                _context.Fax.Add(emptyFax);
                await _context.SaveChangesAsync().ConfigureAwait(false);

                return(RedirectToPage("./Index"));
            }
            return(null);
        }
コード例 #2
0
ファイル: FaxService.cs プロジェクト: brancoisrael/xml2rfa
        /// <summary>
        /// Metodo para rotear faxes para os usuarios de destino
        /// </summary>
        /// <param name="fax"></param>
        /// <param name="dadosFaxDTO"></param>
        private void routToUser(Fax fax, DadosFaxDTO dadosFaxDTO)
        {
            if (Directory.Exists(PropertiesUtil.getInstance().getProperties("dir_xml_processados")))
            {
                User user = userService.findUser(dadosFaxDTO.RoutingCode);

                if (user != null)
                {
                    fax.BillingCode1 = dadosFaxDTO.Billinfo1;
                    fax.BillingCode2 = dadosFaxDTO.Billinfo2;
                    fax.FromName     = dadosFaxDTO.Comments;
                    fax.UserComments = dadosFaxDTO.FromName;
                    fax.ToName       = dadosFaxDTO.RoutingCode;
                    fax.ToFaxNumber  = "990000";

                    fax.Save(BoolType.True);
                    fax.RouteToUser(user, "XML2URAFAX");
                    xmlService.moveXMLProcessed(StringUtils.pathXMLSouce(dadosFaxDTO.codigoFax));
                }
                else
                {
                    Logger.LOGGER_INF("Usuário com routing code {0} não encontrado.".Replace("{0}", dadosFaxDTO.RoutingCode));
                }
            }
            else
            {
                Logger.LOGGER_ERROR("Não é possível mover arquivos XML, propriedade dir_xml_processados não configurado.");
            }
        }
コード例 #3
0
ファイル: Customer.cs プロジェクト: barkerest/atera_api_v3
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = CustomerID;
         hashCode = (hashCode * 397) ^ (CustomerName != null ? CustomerName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BusinessNumber != null ? BusinessNumber.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Domain != null ? Domain.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Address != null ? Address.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (State != null ? State.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ZipCode != null ? ZipCode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Fax != null ? Fax.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Notes != null ? Notes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Logo != null ? Logo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Website != null ? Website.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Longitude.GetHashCode();
         hashCode = (hashCode * 397) ^ Latitude.GetHashCode();
         hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ LastModified.GetHashCode();
         return(hashCode);
     }
 }
コード例 #4
0
ファイル: RightFAX.cs プロジェクト: gshacklock/BMWMonaco2
        string ANI(Fax fax)
        {
            // Find the ANI Number in the Fax History Sudo XML
            // Cannot use XML Classes as the content can containg & < > etc
            // code from Gary to extract ANI Number.
            string result = "Withheld";

            foreach (FaxHistory fh in fax.Histories)
            {
                string xmlhist = fh.XML;
                string cmlhis2 = fh.ToString();

                // Find <ANI> in String
                int ANIPos = xmlhist.IndexOf("<ANI>");
                if (ANIPos > -1)
                {
                    // ANI Exists, so extract
                    int ANIEnd = xmlhist.IndexOf(@"</ANI>");
                    if (ANIEnd > -1)
                    {
                        string ANINum = xmlhist.Substring(ANIPos + 5, (ANIEnd - ANIPos - 5));
                        result = ANINum;
                    }
                }
            }
            return(result);
        }
コード例 #5
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (BuyerId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PrimaryPhone?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SecondaryPhone?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Fax?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (WebSite?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Company?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AnnualTurnOver?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (LegalRepresentative?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Rating?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreditInsurance.GetHashCode());
            hashCode = hashCode * -1521134295 + (Logo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AddressOne?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AddressTwo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (VatNumber?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ContactPerson?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Prefix?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Temp?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (UserName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PasswordHash?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SecurityStamp?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EmailConfirmed.GetHashCode());
            hashCode = hashCode * -1521134295 + (LockoutEnabled.GetHashCode());
            hashCode = hashCode * -1521134295 + (PhoneNumberConfirmed.GetHashCode());
            hashCode = hashCode * -1521134295 + (TwoFactorEnabled.GetHashCode());
            hashCode = hashCode * -1521134295 + (AccessFailedCount?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Name?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Email?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PhoneNumber?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (LockoutEndDate?.GetHashCode() ?? 0);
            return(hashCode);
        }
コード例 #6
0
        public async Task <IActionResult> Edit(int id, [Bind("FaxId,FaxValue,FaxComment")] Fax fax)
        {
            if (id != fax.FaxId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fax);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FaxExists(fax.FaxId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(fax));
        }
コード例 #7
0
        /// <summary>
        /// This method creates any entity records that this sample requires.
        /// </summary>
        public void CreateRequiredRecords()
        {
            // Get the current user.
            WhoAmIRequest  userRequest  = new WhoAmIRequest();
            WhoAmIResponse userResponse = (WhoAmIResponse)_serviceProxy.Execute(userRequest);

            _userId = userResponse.UserId;

            // Create the activity party for sending and receiving the fax.
            ActivityParty party = new ActivityParty
            {
                PartyId = new EntityReference(SystemUser.EntityLogicalName, _userId)
            };

            // Create the fax object.
            Fax fax = new Fax
            {
                Subject = "Sample Fax",
                From    = new ActivityParty[] { party },
                To      = new ActivityParty[] { party }
            };

            _faxId = _serviceProxy.Create(fax);
            Console.WriteLine("Created a fax: '{0}'.", fax.Subject);
        }
コード例 #8
0
        static void Main(string[] args)
        {
            Fax fax = new Fax {
                FaxErrorCode = 500, ErrorDescription = "Fax gönderilemedi."
            };

            IErrorModel[] errors =
            {
                new DBError      {
                    ErrorNumber = 200, Description = "Baglanti yok"
                },
                new DBError      {
                    ErrorNumber = 201, Description = "Sorgu yapilamadi."
                },
                new ServiceError {
                    ErrorNumber = 300, Description = "Servis yok"
                },
                new ServiceError {
                    ErrorNumber = 301, Description = "Yetki Yok"
                },
                new FaxAdapter(fax)
            };

            foreach (IErrorModel error in errors)
            {
                error.SendMail();
            }
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: ElianaArt/2015
 static void Main(string[] args)
 {
     MailMenager mm = new MailMenager();
     Fax fax = new Fax(mm);
     mm.SimulateNewMail("a","b","c");
     Console.ReadLine();
 }
コード例 #10
0
 public ShopSelectBuild WhereFaxLike(params string[] Fax)
 {
     if (Fax == null || Fax.Where(a => !string.IsNullOrEmpty(a)).Any() == false)
     {
         return(this);
     }
     return(this.Where1Or(@"a.`fax` LIKE {0}", Fax.Select(a => "%" + a + "%").ToArray()));
 }
コード例 #11
0
        static void Main(string[] args)
        {
            var mngr = new MailManager();
            var post = new Post(mngr);
            var fax  = new Fax(mngr);

            mngr.SimulateNewMail("*****@*****.**", "Students", "Hello world");
        }
コード例 #12
0
            public override XElement GenerateAddRq()
            {
                XElement Add = new XElement("CustomerAdd");

                Add.Add(Name?.ToQBXML(nameof(Name)));
                Add.Add(IsActive.ToQBXML(nameof(IsActive)));
                Add.Add(ClassRef?.ToQBXML(nameof(ClassRef)));
                Add.Add(ParentRef?.ToQBXML(nameof(ParentRef)));
                Add.Add(CompanyName?.ToQBXML(nameof(CompanyName)));
                Add.Add(Salutation?.ToQBXML(nameof(Salutation)));
                Add.Add(FirstName?.ToQBXML(nameof(FirstName)));
                Add.Add(MiddleName?.ToQBXML(nameof(MiddleName)));
                Add.Add(LastName?.ToQBXML(nameof(LastName)));
                Add.Add(JobTitle?.ToQBXML(nameof(JobTitle)));
                Add.Add(BillAddress?.ToQBXML(nameof(BillAddress)));
                Add.Add(ShipAddress?.ToQBXML(nameof(ShipAddress)));
                Add.Add(ShipToAddress?.ToQBXML(nameof(ShipToAddress)));
                Add.Add(Phone?.ToQBXML(nameof(Phone)));
                Add.Add(AltPhone?.ToQBXML(nameof(AltPhone)));
                Add.Add(Fax?.ToQBXML(nameof(Fax)));
                Add.Add(Email?.ToQBXML(nameof(Email)));
                Add.Add(Cc?.ToQBXML(nameof(Cc)));
                Add.Add(Contact?.ToQBXML(nameof(Contact)));
                Add.Add(AltContact?.ToQBXML(nameof(AltContact)));
                Add.Add(AdditionalContactRef?.ToQBXML(nameof(AdditionalContactRef)));
                Add.Add(Contacts?.ToQBXML <Contacts>(nameof(Contacts)));
                Add.Add(CustomerTypeRef?.ToQBXML(nameof(CustomerTypeRef)));
                Add.Add(TermsRef?.ToQBXML(nameof(TermsRef)));
                Add.Add(SalesRepRef?.ToQBXML(nameof(SalesRepRef)));
                Add.Add(OpenBalance?.ToQBXML(nameof(OpenBalance)));
                Add.Add(OpenBalanceDate?.ToQBXML(nameof(OpenBalanceDate)));
                Add.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef)));
                Add.Add(ItemSalesTaxRef?.ToQBXML(nameof(ItemSalesTaxRef)));
                Add.Add(ResaleNumber?.ToQBXML(nameof(ResaleNumber)));
                Add.Add(AccountNumber?.ToQBXML(nameof(AccountNumber)));
                Add.Add(CreditLimit?.ToQBXML(nameof(CreditLimit)));
                Add.Add(PreferredPaymentMethodRef?.ToQBXML(nameof(PreferredPaymentMethodRef)));
                Add.Add(CreditCardInfo?.ToQBXML(nameof(CreditCardInfo)));
                Add.Add(JobStatus.ToQBXML(nameof(JobStatus)));
                Add.Add(JobStartDate?.ToQBXML(nameof(JobStartDate)));
                Add.Add(JobProjectedEndDate?.ToQBXML(nameof(JobProjectedEndDate)));
                Add.Add(JobEndDate?.ToQBXML(nameof(JobEndDate)));
                Add.Add(JobDesc?.ToQBXML(nameof(JobDesc)));
                Add.Add(JobTypeRef?.ToQBXML(nameof(JobTypeRef)));
                Add.Add(Notes?.ToQBXML(nameof(Notes)));
                Add.Add(AdditionalNotes?.ToQBXML(nameof(AdditionalNotes)));
                Add.Add(PreferredDeliveryMethod.ToQBXML(nameof(PreferredDeliveryMethod)));
                Add.Add(PriceLevelRef?.ToQBXML(nameof(PriceLevelRef)));
                Add.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID)));
                Add.Add(CurrencyRef?.ToQBXML(nameof(CurrencyRef)));

                XElement AddRq = new XElement("CustomerAddRq");

                AddRq.Add(Add);
                AddRq.Add(IncludeRetElement?.ToQBXML(nameof(IncludeRetElement)));

                return(AddRq);
            }
コード例 #13
0
        public void Update(Fax fax, bool externalIsTest, int externalPages, int externalCents, string externalStatus, DateTime?externalCompletedAt)
        {
            fax.ExternalIsTest      = externalIsTest;
            fax.ExternalPages       = externalPages;
            fax.ExternalCents       = externalCents;
            fax.ExternalStatus      = externalStatus;
            fax.ExternalCompletedAt = externalCompletedAt;

            Context.SubmitChanges();
        }
コード例 #14
0
        public void ShouldNotResponseToNewMailEventWhenUnregistered()
        {
            var mailManager = new MailManager();
            var fax = new Fax(mailManager);

            mailManager.SimulateNewMail("Nick", "Carry", "Hello World");

            fax.Unregister(mailManager);
            mailManager.SimulateNewMail("Nancy", "James", "Good Morning");
        }
コード例 #15
0
ファイル: FaxMapping.cs プロジェクト: hburaksavas/HtmlObjects
        private List <Fax> GetDistinctFaxList()
        {
            List <string> faxNoKeyList    = new List <string>();
            List <Fax>    distinctFaxList = new List <Fax>(); // distinct fax list

            try
            {
                foreach (var item in matchedFaxList)
                {
                    faxNoKeyList.Add(item.matchedFaxNo);
                }

                IEnumerable <string> distinctFaxNoKeyList = faxNoKeyList.Distinct(); // fax no tutulan liste
                List <int>           matchLengthList      = new List <int>();        // eşleşme uzunluklarının tutulduğu liste

                foreach (var item in faxNoKeyList)
                {
                    foreach (var faxObj in matchedFaxList)
                    {
                        if (faxObj.matchedFaxNo.Equals(item))
                        {
                            matchLengthList.Add(faxObj.matchedLength);
                        }
                    }

                    int minLength = 1001;
                    foreach (var count in matchLengthList)
                    {
                        if (count < minLength)
                        {
                            minLength = count;
                        }
                    }

                    matchLengthList.Clear();

                    foreach (var faxObj in matchedFaxList)
                    {
                        if (faxObj.matchedLength.Equals(minLength) && faxObj.matchedFaxNo.Equals(item))
                        {
                            Fax faxValue = new Fax();
                            faxValue.matchedFirmName = faxObj.matchedFirmName;
                            faxValue.matchedFaxNo    = item;
                            distinctFaxList.Add(faxValue);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                PrintConsole.LOG(e.StackTrace, e.Message);
            }

            return(distinctFaxList);
        }
コード例 #16
0
        public async Task <IActionResult> Create([Bind("FaxId,FaxValue,FaxComment")] Fax fax)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fax);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(fax));
        }
コード例 #17
0
ファイル: RightFAX.cs プロジェクト: gshacklock/BMWMonaco2
        private bool ExportData(string fileName, Fax fax)
        {
            bool result = CreatePDF(fax, fileName);

            // 18/10/2010 - requested that the XML File is no longer required.
            //if (true == result)
            //{
            //    result = CreateXMLFile(fax, folderName, "BatchData.xml", batchId);
            //}
            return(result);
        }
コード例 #18
0
        static void Main(string[] args)
        {
            var manager = new MailManager();
            var fax     = new Fax();

            EventRegistrar.RegisterEvent(manager, "NewMail", fax, "FaxMsg");

            manager.SimulateNewMail("Minsk", "Riga", "Letter");

            Console.ReadKey();
        }
コード例 #19
0
        public static void Go()
        {
            MailManager mm = new MailManager();

            Fax fax = new Fax(mm);

            Pager pager = new Pager(mm);

            mm.SimulateNewMail("Jeffrey", "Kristin", "Tra tata");

            fax.Unregister(mm);

            mm.SimulateNewMail("Jeffrey", "Mom & Dad", "Happy Birthday.");
        }
コード例 #20
0
        protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
        {
            // Object Container: Use objectContainer.Get<T>() to retrieve objects from the scope
            var objectContainer = context.GetFromContext <IObjectContainer>(TwilioApiScope.ParentContainerPropertyTag);

            // Inputs
            var fax  = Fax.Get(context);
            var path = Path.Get(context);

            var media = await FaxWrappers.DownloadFaxMediaAsync(objectContainer.Get <ITwilioRestClient>(), fax, path);

            // Outputs
            return((ctx) => {
                FaxMediaPDF.Set(ctx, media);
            });
        }
コード例 #21
0
ファイル: RightFAX.cs プロジェクト: gshacklock/BMWMonaco2
        private bool CreateXMLFile(Fax fax, string folderName, string fileName, string batchId)
        {
            bool result = false;

            try
            {
                BatchContainer myFax   = new BatchContainer();
                FaxBatch       myBatch = new FaxBatch();
                Document[]     myDocuments;
                myDocuments              = new Document[1];
                myDocuments[0]           = new Document();
                myDocuments[0].id        = 1;
                myDocuments[0].pageCount = fax.TotalPages;

                myBatch.id       = Convert.ToInt32(batchId);
                myBatch.timezone = "GMT";
                string fromFaxNumber = ANI(fax);
                if (String.Empty == fromFaxNumber.Trim())
                {
                    fromFaxNumber = "Not Available";
                }
                myBatch.sourceCli = fromFaxNumber;
                string toFaxNumber = fax.OwnerID;
                if (String.Empty == toFaxNumber.Trim())
                {
                    toFaxNumber = "Not Available";
                }
                myBatch.dateTime       = fax.FaxRecordDateTime;
                myBatch.destinationCli = toFaxNumber;
                myBatch.documents      = myDocuments;
                myFax.batch            = myBatch;

                // Serialization
                XmlSerializer sFax = new XmlSerializer(typeof(BatchContainer));
                TextWriter    wFax = new StreamWriter(folderName + @"\" + fileName);
                sFax.Serialize(wFax, myFax);
                wFax.Close();
                result = true;
            }
            catch (Exception ex)
            {
                Trace.WriteLine("General Exception occurred in method CreateXMLFile with: " + ex.Message, "exceptions");
                result = false;
            }

            return(result);
        }
コード例 #22
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (InvestorId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PrimaryPhone?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SecondaryPhone?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Fax?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (WebSite?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Company?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ContactPerson?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Logo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SupervisingAuthority?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RegistrationNo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DomainFocus?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TurnOver?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (VatNumber?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AddressTwo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AddressOne?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ManagingDirector?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TargetMarket?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CustomerSizeFrom?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CustomerSizeTo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (LocalJurisdiction?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CommercialRegNo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OtherMinRequirements?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CRR.GetHashCode());
            hashCode = hashCode * -1521134295 + (UploadCompliance?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OtherMemberships?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OtherDomainFocus?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InvestorStatus?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IAFC.GetHashCode());
            hashCode = hashCode * -1521134295 + (Prefix?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (UserName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PasswordHash?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SecurityStamp?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EmailConfirmed.GetHashCode());
            hashCode = hashCode * -1521134295 + (LockoutEnabled.GetHashCode());
            hashCode = hashCode * -1521134295 + (PhoneNumberConfirmed.GetHashCode());
            hashCode = hashCode * -1521134295 + (TwoFactorEnabled.GetHashCode());
            hashCode = hashCode * -1521134295 + (AccessFailedCount?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Name?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Email?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PhoneNumber?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (LockoutEndDate?.GetHashCode() ?? 0);
            return(hashCode);
        }
コード例 #23
0
        /// <summary>
        /// Convert a fax to a task.
        /// <param name="serverConfig">Contains server connection information.</param>
        /// <param name="promptforDelete">When True, the user will be prompted to delete all
        /// created entities.</param>
        /// </summary>
        public void Run(ServerConnection.Configuration serverConfig, bool promptForDelete)
        {
            try
            {
                // Connect to the Organization service.
                // The using statement assures that the service proxy will be properly disposed.
                using (_serviceProxy = new OrganizationServiceProxy(serverConfig.OrganizationUri, serverConfig.HomeRealmUri,
                                                                    serverConfig.Credentials, serverConfig.DeviceCredentials))
                {
                    // This statement is required to enable early-bound type support.
                    _serviceProxy.EnableProxyTypes();

                    // Call the method to create any data that this sample requires.
                    CreateRequiredRecords();

                    //<snippetConvertFaxToTask1>

                    // Retrieve the fax.
                    Fax retrievedFax = (Fax)_serviceProxy.Retrieve(Fax.EntityLogicalName, _faxId, new ColumnSet(true));

                    // Create a task.
                    Task task = new Task()
                    {
                        Subject      = "Follow Up: " + retrievedFax.Subject,
                        ScheduledEnd = retrievedFax.CreatedOn.Value.AddDays(7),
                    };
                    _taskId = _serviceProxy.Create(task);

                    // Verify that the task has been created
                    if (_taskId != Guid.Empty)
                    {
                        Console.WriteLine("Created a task for the fax: '{0}'.", task.Subject);
                    }

                    //</snippetConvertFaxToTask1>

                    DeleteRequiredRecords(promptForDelete);
                }
            }

            // Catch any service fault exceptions that Microsoft Dynamics CRM throws.
            catch (FaultException <Microsoft.Xrm.Sdk.OrganizationServiceFault> )
            {
                // You can handle an exception here or pass it back to the calling method.
                throw;
            }
        }
コード例 #24
0
        private Fax ConvertirAFax(int idusuario)
        {
            Fax fx = null;

            bdanexoDataSet.faxDataTable fax = faxTableAdapter1.GetFaxByUsuario(idusuario);
            if (fax.Rows.Count > 0)
            {
                fx              = new Fax();
                fx.marca        = ((bdanexoDataSet.faxRow)fax.Rows[0]).marca;
                fx.noserie      = ((bdanexoDataSet.faxRow)fax.Rows[0]).noserie;
                fx.modelo       = ((bdanexoDataSet.faxRow)fax.Rows[0]).modelo;
                fx.noinventario = ((bdanexoDataSet.faxRow)fax.Rows[0]).noinventario;
                fx.estado       = ((bdanexoDataSet.faxRow)fax.Rows[0]).estado;
                fx.id           = ((bdanexoDataSet.faxRow)fax.Rows[0]).Id;
            }
            return(fx);
        }
コード例 #25
0
ファイル: Edit.cshtml.cs プロジェクト: jmuelbert/jmbde-aspnet
        /// <summary>
        /// Ons the get async.
        /// </summary>
        /// <returns>The get async.</returns>
        /// <param name="id">Identifier.</param>
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            _logger.LogDebug($"Faxes/Edit/OnGetAsync({ id })");

            if (id == null)
            {
                return(NotFound());
            }

            Fax = await _context.Fax.FindAsync(id).ConfigureAwait(false);

            if (Fax == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #26
0
        public Fax Create(string to, string number, string subject, string message, string ip)
        {
            var fax = new Fax
            {
                Name         = to,
                Number       = number,
                Subject      = subject,
                Text         = message,
                CreatedOnUtc = DateTime.UtcNow,
                IpAddress    = ip
            };

            Context.Faxes.InsertOnSubmit(fax);
            Context.SubmitChanges();

            return(fax);
        }
コード例 #27
0
        public string GetFormattedDetails()
        {
            List <string> details = new List <string>();

            if (Institution != "")
            {
                details.Add(Institution);
            }
            if (StreetName != "")
            {
                details.Add(StreetName + (StreetNumber != "" ? Characters.FIXED_SPACE + StreetNumber : "") + (Box != "" ? Characters.FIXED_SPACE + Box : ""));
            }
            if (PostalCode != "")
            {
                details.Add(PostalCode + (Town != "" ? Characters.FIXED_SPACE + Town : ""));
            }
            if (Telephone != "" && Telephone.Equals(Fax))
            {
                if (Telephone != "")
                {
                    details.Add("T/F" + Characters.FIXED_SPACE + Telephone.Replace("-", Characters.NOBREAK_HYPHEN));
                }
            }
            else
            {
                if (Telephone != "")
                {
                    details.Add("T" + Characters.FIXED_SPACE + Telephone.Replace("-", Characters.NOBREAK_HYPHEN));
                }
                if (Fax != "")
                {
                    details.Add("F" + Characters.FIXED_SPACE + Fax.Replace("-", Characters.NOBREAK_HYPHEN));
                }
            }
            if (Cellphone != "")
            {
                details.Add("G" + Characters.FIXED_SPACE + Cellphone.Replace("-", Characters.NOBREAK_HYPHEN));
            }
            if (Email != "")
            {
                details.Add(Email);
            }

            return(string.Join(Characters.FIXED_SPACE + Characters.NOBREAK_HYPHEN + " ", details.ToArray()));
        }
コード例 #28
0
ファイル: User.cs プロジェクト: ishakdolek/GrpcDemo
        public override int GetHashCode()
        {
            int hash = 1;

            if (Fax.Length != 0)
            {
                hash ^= Fax.GetHashCode();
            }
            if (Skypeid.Length != 0)
            {
                hash ^= Skypeid.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #29
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CompanyName != null ? CompanyName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ContactName != null ? ContactName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ContactTitle != null ? ContactTitle.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Address != null ? Address.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Region != null ? Region.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PostalCode != null ? PostalCode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Fax != null ? Fax.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Picture != null ? Picture.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #30
0
        public void Create_AccountPage()
        {
            Fname.SendKeys("Testing");
            Lname.SendKeys("Guru");
            Email.SendKeys("*****@*****.**");
            TelePhone.SendKeys("07777777");
            Fax.SendKeys("012345");
            Company.SendKeys("IT_Tech");
            Address1.SendKeys("BFD");
            Address2.SendKeys("city road");
            City.SendKeys("Leeds");



            //DropDown list for Country
            SelectElement DropDown2 = new SelectElement(Country_UK);

            DropDown2.SelectByText("United Kingdom");
            BasePage.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            //DropDown list for State/Region
            SelectElement DropDown1 = new SelectElement(RegionState);

            DropDown1.SelectByText("West Yorkshire");
            BasePage.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            ZipCode.SendKeys("12345");



            CountryDropDownClick.Click();
            //Country_UK.Click();

            LoginName.SendKeys("tguru2713");
            Password.SendKeys("123qwe");
            ConfirmPass.SendKeys("123qwe");
            Suscribe.Click();
            TermsCondition.Click();
            ContinueBtn1.Click();
            ContinueBtn2.Click();
            //Assert.IsTrue
        }
コード例 #31
0
    public static void Go()
    {
        // Construct a MailManager object
        MailManager mm = new MailManager();

        // Construct a Fax object passing it the MailManager object
        Fax fax = new Fax(mm);

        // Construct a Pager object passing it the MailManager object
        Pager pager = new Pager(mm);

        // Simulate an incoming mail message
        mm.SimulateNewMail("Jeffrey", "Kristin", "I Love You!");

        // Force the Fax object to unregister itself with the MailManager
        fax.Unregister(mm);

        // Simulate an incoming mail message
        mm.SimulateNewMail("Jeffrey", "Mom & Dad", "Happy Birthday.");
    }
コード例 #32
0
        /// <summary>
        /// Retorna o texto do registro do tipo 10 para uso do SIntegra.
        /// </summary>
        /// <returns>Uma string com os dados formatados para uso do SIntegra.</returns>
        public override string ToString()
        {
            // Formata os campos para montar a resposta
            string n01 = Tipo.ToString().PadLeft(2, '0');
            string n02 = CNPJ.PadLeft(14, '0');
            string n03 = InscEstadual.PadRight(14);
            string n04 = Nome.PadRight(35);
            string n05 = Municipio.PadRight(30);
            string n06 = UF.PadRight(2);
            string n07 = Fax.PadLeft(10, '0');
            string n08 = FormatData(DataInicio);
            string n09 = FormatData(DataFim);
            string n10 = ((int)IdentificacaoEstrutura).ToString();
            string n11 = ((int)NaturezaOperacoes).ToString();
            string n12 = ((int)FinalidadeArquivo).ToString();

            // Retorna a string
            return(n01 + n02 + n03 + n04 + n05 + n06 + n07 + n08 + n09 + n10 +
                   n11 + n12);
        }
コード例 #33
0
        /// <summary>
        /// This method first connects to the Organization service. Afterwards a dynamic
        /// list is created and associated to the campaign and the campaign's activity.
        /// Then the dynamic list is copied to a static list and associated with the same
        /// campaign and campaign activity. Finally the sample distributes the campaign
        /// to both the dynamic and static lists.
        /// </summary>
        /// <param name="serverConfig">Contains server connection information.</param>
        /// <param name="promptforDelete">When True, the user will be prompted to delete all
        /// created entities.</param>
        public void Run(ServerConnection.Configuration serverConfig, bool promptforDelete)
        {
            try
            {
                //<snippetMarketingAutomation1>
                // Connect to the Organization service. 
                // The using statement assures that the service proxy will be properly disposed.
                using (_serviceProxy = new OrganizationServiceProxy(serverConfig.OrganizationUri, serverConfig.HomeRealmUri,serverConfig.Credentials, serverConfig.DeviceCredentials))
                {
                    // This statement is required to enable early-bound type support.
                    _serviceProxy.EnableProxyTypes();

                    CreateRequiredRecords();

                    #region Create Dynamic List

                    // Create FetchXml for marketing list's query which locates accounts
                    // in Seattle.
                    String fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
                                        <entity name='account'>
                                        <attribute name='name' />
                                        <attribute name='address1_city' />
                                        <attribute name='primarycontactid' />
                                        <attribute name='telephone1' />
                                        <attribute name='accountid' />
                                        <order attribute='name' descending='false' />
                                        <filter type='and'>
                                        <condition attribute='address1_city' operator='eq' value='seattle' />
                                        </filter>
                                        </entity>
                                        </fetch>";
                    //<snippetAddItemCampaign>
                    // Create dynamic list. Set the type to true to declare a dynamic
                    // list.
                    List dynamicList = new List()
                    {
                        Type = true,
                        ListName = "Dynamic List",
                        CreatedFromCode = new OptionSetValue((int)ListCreatedFromCode.Account),
                        Query = fetchXml
                    };
                    _dynamicListId = _serviceProxy.Create(dynamicList);
                    dynamicList.Id = _dynamicListId;

                    Console.WriteLine("Created dynamic list.");

                    #endregion

                    #region Associate dynamic list to campaign

                    // Create a campaign.
                    Campaign campaign = new Campaign()
                    {
                        Name = "Sample Campaign"
                    };
                    _campaignId = _serviceProxy.Create(campaign);
                    campaign.Id = _campaignId;

                    // Add the dynamic list to the campaign.
                    AddItemCampaignRequest addListToCampaignRequest =
                        new AddItemCampaignRequest()
                        {
                            CampaignId = _campaignId,
                            EntityId = _dynamicListId,
                            EntityName = List.EntityLogicalName,
                        };
                    _serviceProxy.Execute(addListToCampaignRequest);

                    Console.WriteLine("Added dynamic list to the campaign.");
                    //</snippetAddItemCampaign>

                    //<snippetAddItemCampaignActivity>
                    // Create a campaign activity to distribute fax to the list members.
                    CampaignActivity campaignActivity = new CampaignActivity()
                    {
                        Subject = "Sample Campaign Activity",
                        ChannelTypeCode = new OptionSetValue((int)CampaignActivityChannelTypeCode.Fax),
                        RegardingObjectId = campaign.ToEntityReference()
                    };
                    _campaignActivityId = _serviceProxy.Create(campaignActivity);

                    // Add dynamic list to campaign activity.
                    AddItemCampaignActivityRequest addListToCampaignActivityRequest = 
                        new AddItemCampaignActivityRequest()
                    {
                        CampaignActivityId = _campaignActivityId,
                        ItemId = _dynamicListId,
                        EntityName = List.EntityLogicalName
                    };
                    _serviceProxy.Execute(addListToCampaignActivityRequest);

                    Console.WriteLine("Added dynamic list to the campaign activity.");
                    //</snippetAddItemCampaignActivity>

                    #endregion

                    #region Associate static list to campaign
                    //<snippetCopyDynamicListToStatic>

                    // Copy the dynamic list to a static list.
                    CopyDynamicListToStaticRequest copyRequest = 
                        new CopyDynamicListToStaticRequest()
                        {
                            ListId = _dynamicListId
                        };
                    CopyDynamicListToStaticResponse copyResponse =
                        (CopyDynamicListToStaticResponse)_serviceProxy.Execute(copyRequest);
                    _staticListId = copyResponse.StaticListId;

                    Console.WriteLine("Copied dynamic list to a static list.");
                    //</snippetCopyDynamicListToStatic>

                    // Add the static list to the campaign.
                    AddItemCampaignRequest addStaticListToCampaignRequest =
                        new AddItemCampaignRequest()
                        {
                            CampaignId = _campaignId,
                            EntityId = _staticListId,
                            EntityName = List.EntityLogicalName
                        };
                    _serviceProxy.Execute(addStaticListToCampaignRequest);

                    Console.WriteLine("Added static list to the campaign.");

                    // Add the static list to the campaign activity.
                    AddItemCampaignActivityRequest addStaticListToCampaignActivityRequest = 
                        new AddItemCampaignActivityRequest()
                    {
                        CampaignActivityId = _campaignActivityId,
                        ItemId = _staticListId,
                        EntityName = List.EntityLogicalName
                    };
                    _serviceProxy.Execute(addStaticListToCampaignActivityRequest);

                    Console.WriteLine("Added static list to the campaign's activity.");

                    #endregion

                    #region Create fax for campaign's activity
                    // Create a fax.
                    Fax fax = new Fax()
                    {
                        Subject = "Example Fax"
                    };

                    Console.WriteLine("Created fax for campaign's activity.");
                    #endregion Create fax for campaign's activity

                    #region Distribute fax to the marketing list
                    //<snippetDistributeCampaignActivity>
                    // Distribute the campaign activity to the marketing lists.
                    DistributeCampaignActivityRequest distributeRequest = 
                        new DistributeCampaignActivityRequest() 
                        { 
                            CampaignActivityId = _campaignActivityId,
                            Activity = fax,
                            Owner = new EntityReference("systemuser", _salesManagerId),
                            Propagate = true,
                            SendEmail = false,
                            PostWorkflowEvent = true
                        };
                    _serviceProxy.Execute(distributeRequest);

                    Console.WriteLine("Distributed fax to the marketing lists.");
                    //</snippetDistributeCampaignActivity>
                    #endregion Distribute fax to the marketing list

                    #region Retrieve collection of entities from marketing list
                    // Retrieve a collection of entities that correspond 
                    // to all of the members in a marketing list
                    // This approach of retrieving list members allows you to dynamically
                    // retrieve the members of a list programmatically without requiring 
                    // knowledge of the member entity type.
                    OrganizationServiceContext orgContext = 
                        new OrganizationServiceContext(_serviceProxy);

                    var member = (from mb in orgContext.CreateQuery<List>()
                                  where mb.Id == _dynamicListId
                                  select mb).FirstOrDefault();

                    string fetchQuery = member.Query;

                    RetrieveMultipleRequest memberRequest = new RetrieveMultipleRequest();
                    FetchExpression fetch = new FetchExpression(fetchQuery);
                    memberRequest.Query = fetch;
                    RetrieveMultipleResponse memberResponse = 
                        (RetrieveMultipleResponse)_serviceProxy.Execute(memberRequest);

                    Console.WriteLine("Retrieved collection of entities from a marketing list.");
                    #endregion Retrieve collection of entities from marketing list

                    DeleteRequiredRecords(promptforDelete);
                }
                //</snippetMarketingAutomation1>
            }

            // Catch any service fault exceptions that Microsoft Dynamics CRM throws.
            catch (FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault>)
            {
                // You can handle an exception here or pass it back to the calling method.
                throw;
            }
        }
コード例 #34
0
ファイル: ConvertFaxToTask.cs プロジェクト: cesugden/Scripts
        /// <summary>
        /// This method creates any entity records that this sample requires.        
        /// </summary>
        public void CreateRequiredRecords()
        {
            // Get the current user.
            WhoAmIRequest userRequest = new WhoAmIRequest();
            WhoAmIResponse userResponse = (WhoAmIResponse)_serviceProxy.Execute(userRequest);
            _userId = userResponse.UserId;

            // Create the activity party for sending and receiving the fax.
            ActivityParty party = new ActivityParty
            {
                PartyId = new EntityReference(SystemUser.EntityLogicalName, _userId)
            };

            // Create the fax object.
            Fax fax = new Fax
            {
                Subject = "Sample Fax",
                From = new ActivityParty[] { party },
                To = new ActivityParty[] { party }
            };
            _faxId = _serviceProxy.Create(fax);
            Console.WriteLine("Created a fax: '{0}'.", fax.Subject);
        }