コード例 #1
0
        public ActionResult UpdateContactDetails(ContactDetails contactDetails)
        {
            //call api to reset the password
            //get the current user
            var user = _authenticationManager.User;

            if (user == null)
            {
                return UnauthorisedJson();
            }

            var subClaim = user.Claims.FirstOrDefault(c => c.Type == "sub");
            if (subClaim == null)
            {
                return UnauthorisedJson();
            }

            var response = _coreClient.UpdateContactDetails(subClaim.Value, contactDetails);
            if (!response.Errored)
            {
                return Json(new { success = true });
            }
            Response.StatusCode = (int)HttpStatusCode.BadRequest;
            return Json(new { success = false });
        }
コード例 #2
0
        public static ContactDetails Create(ISettings settings, bool isUkBased)
        {
            ContactDetails contactDetails = new ContactDetails();

            if (!settings.IgnoreStringLengthConditions)
            {
                contactDetails.Title = RandomHelper.CreateRandomString("Title ", 1, 35);
                contactDetails.Forename = RandomHelper.CreateRandomString("Forename ", 1, 35);
                contactDetails.Surname = RandomHelper.CreateRandomString("Surname ", 1, 35);
                contactDetails.PhoneLandLine = RandomHelper.CreateRandomStringOfNumbers(10, 35);
                contactDetails.PhoneMobile = RandomHelper.CreateRandomStringOfNumbers(10, 35);
                contactDetails.Fax = RandomHelper.CreateRandomStringOfNumbers(10, 35);
                contactDetails.Email = RandomHelper.CreateRandomString("WEEE_", 10, 15, false) + "@environment-agency.gov.uk";
            }
            else
            {
                contactDetails.Title = RandomHelper.CreateRandomString("Title ", 0, 1000);
                contactDetails.Forename = RandomHelper.CreateRandomString("Forename ", 0, 1000);
                contactDetails.Surname = RandomHelper.CreateRandomString("Surname ", 0, 1000);
                contactDetails.PhoneLandLine = RandomHelper.CreateRandomStringOfNumbers(0, 1000);
                contactDetails.PhoneMobile = RandomHelper.CreateRandomStringOfNumbers(0, 1000);
                contactDetails.Fax = RandomHelper.CreateRandomStringOfNumbers(0, 1000);
                contactDetails.Email = RandomHelper.CreateRandomString("WEEE_", 0, 1000, false) + "@environment-agency.gov.uk";
            }

            contactDetails.Address = Address.Create(settings, isUkBased);

            return contactDetails;
        }
コード例 #3
0
ファイル: Default.aspx.cs プロジェクト: shekar348/1PointOne
        public void MailServiceTestingWithQueryString(string templateName, string subject, ContactDetails[] Recipients)
        {
            int templateID = 0;
            string str = "";
            XmlNode template = obj.GetTemplateIdByTemplateName("anwar", "anwar", templateName);
            if (template["TemplateId"] != null && template["TemplateId"].InnerText.Trim().Length > 0)
            {
                templateID = Convert.ToInt32(template["TemplateId"].InnerText);
            }

            if (Recipients != null)
            {
                string str1;
                XmlNode listId = obj.AddList("anwar", "anwar", "4VL_" + DateTime.Now);

                foreach (ContactDetails contact in Recipients)
                {

                    XmlNode xnList = obj.GetRecipientIdbyEmailAddress("anwar", "anwar", contact.EmailID);
                    string RecipientID = (xnList["ID"] != null) ? xnList["ID"].InnerText : null;
                    string BounceCount = (xnList["SoftBounceCount"] != null) ? xnList["SoftBounceCount"].InnerText : null;
                    string Status = (xnList["IsActive"] != null) ? xnList["IsActive"].InnerText : null;
                    String[] MyArray = new String[20];
                    List<string> custFields = new List<string>();

                    if (RecipientID == null)
                    {
                        custFields.Add("Message#" + contact.Message);
                        custFields.Add("Type#" + contact.Type);
                        custFields.Add("GroupID#" + contact.GroupID);
                        custFields.Add("JoinCode#" + contact.JoinCode);
                        custFields.Add("Mode#" + contact.Mode);
                        MyArray = custFields.ToArray();

                        XmlNode y = obj.AddRecipientWithCustomFildList("anwar", "anwar", contact.EmailID, contact.FirstName, contact.LastName, MyArray);
                        RecipientID = y["RecipientId"].InnerText;

                    }
                    else
                    {
                        custFields.Add("Message#" + contact.Message);
                        custFields.Add("Type#" + contact.Type);
                        custFields.Add("GroupID#" + contact.GroupID);
                        custFields.Add("JoinCode#" + contact.JoinCode);
                        custFields.Add("Mode#" + contact.Mode);
                        MyArray = custFields.ToArray();
                        obj.EditRecipientWithCustomFieldList("anwar", "anwar", Convert.ToInt64(RecipientID), contact.EmailID, contact.FirstName, contact.LastName, MyArray);
                    }

                    obj.AddExistingRecipientsToList("anwar", "anwar", Convert.ToInt32(listId["ListId"].InnerText), RecipientID);

                }

                XmlNode comp = obj.AddCampaign("anwar", "anwar", "ClickTest" + DateTime.Now.ToString(), "*****@*****.**", "admin", "*****@*****.**", "testing with cust fillds", templateID, listId["ListId"].InnerText, DateTime.Now);

            }
        }
コード例 #4
0
ファイル: WebService.cs プロジェクト: yanoovoni/Rdroid
    public bool IfContactExist(ContactDetails contactDetais)//הפעולה בודקת האם איש הקשר כבר קיים
    {
        UserService service = new UserService();
        bool x = service.IfContactExist(contactDetais);
        if (x == false)
        {
            service.InsertContact2(contactDetais);
            return true;
        }
        return false;

    }
コード例 #5
0
        public int AddContacts(ContactDetails contacts)
        {
            OpenConnection();
            using OracleCommand oracleCommand = new OracleCommand("programmer.AddContactDetails", Connection)
                  {
                      CommandType = System.Data.CommandType.StoredProcedure
                  };
            oracleCommand.Parameters.Add("email_in", contacts.Email);
            oracleCommand.Parameters.Add("phone_in", contacts.Phone);
            oracleCommand.Parameters.Add("country_in", contacts.Country);
            oracleCommand.Parameters.Add("city_in", contacts.City);
            oracleCommand.Parameters.Add("location_in", contacts.Location);
            OracleParameter result = oracleCommand.Parameters.Add("id_out", OracleDbType.Int32, System.Data.ParameterDirection.Output);

            oracleCommand.ExecuteNonQuery();
            return(int.Parse(result.Value.ToString()));
        }
コード例 #6
0
ファイル: Client.cs プロジェクト: MAq2402/KOService
        public Client(Guid id, string firstName, string lastName, string phoneNumber, string email, string street, string city, string code) : base(id)
        {
            if (string.IsNullOrEmpty(firstName))
            {
                throw new DomainException("First name has not been provided");
            }

            if (string.IsNullOrEmpty(lastName))
            {
                throw new DomainException("Last name has not been provided");
            }

            FirstName      = firstName;
            LastName       = lastName;
            Address        = new Address(street, city, code);
            ContactDetails = new ContactDetails(phoneNumber, email);
        }
コード例 #7
0
ファイル: Reference.cs プロジェクト: zdzislaw/odata.net
        public static ContactDetails CreateContactDetails(global::System.DateTimeOffset lastContacted, global::System.DateTimeOffset contacted, global::System.Guid gUID, global::System.TimeSpan preferedContactTime, byte @byte, sbyte signedByte, double @double, float single, short @short, int @int, long @long)
        {
            ContactDetails contactDetails = new ContactDetails();

            contactDetails.LastContacted       = lastContacted;
            contactDetails.Contacted           = contacted;
            contactDetails.GUID                = gUID;
            contactDetails.PreferedContactTime = preferedContactTime;
            contactDetails.Byte                = @byte;
            contactDetails.SignedByte          = signedByte;
            contactDetails.Double              = @double;
            contactDetails.Single              = single;
            contactDetails.Short               = @short;
            contactDetails.Int  = @int;
            contactDetails.Long = @long;
            return(contactDetails);
        }
コード例 #8
0
        /// <summary>
        /// Gets the position on the to line.
        /// </summary>
        /// <param name="m">The m.</param>
        /// <returns>
        /// The Position
        /// </returns>
        internal static Position GetPosition(Message m)
        {
            Position pos = Position.PartOfList;
            int      ct  = 0;

            for (int i = 0; i < m.SentTo.Count; i++)
            {
                ContactDetails cd = m.SentTo[i];
                if (cd.IsMe)
                {
                    switch (ct)
                    {
                    case 0:
                        pos = Position.FirstInToLine;
                        break;

                    case 1:
                        pos = Position.SecondInToLine;
                        break;

                    default:
                        pos = Position.ThirdOrMoreInToLine;
                        break;
                    }

                    break;
                }

                ct++;
            }

            ct = 0;
            foreach (ContactDetails cd in m.CopiedTo)
            {
                if (cd.IsMe)
                {
                    pos = ct == 0 ? Position.FirstInCcLine : Position.NotFirstInCcLine;
                    break;
                }

                ct++;
            }

            return(pos);
        }
コード例 #9
0
        /// <summary>
        /// GetForPage
        /// Calls [usp_select_Contact_for_Page]
        /// </summary>
        public override ContactDetails GetForPage(System.Int32?contactId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_select_Contact_for_Page", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@ContactId", SqlDbType.Int).Value = contactId;
                cn.Open();
                DbDataReader reader = ExecuteReader(cmd, CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    //return GetContactFromReader(reader);
                    ContactDetails obj = new ContactDetails();
                    obj.ContactId   = GetReaderValue_Int32(reader, "ContactId", 0);
                    obj.ContactName = GetReaderValue_String(reader, "ContactName", "");
                    obj.CompanyNo   = GetReaderValue_NullableInt32(reader, "CompanyNo", null);
                    obj.Inactive    = GetReaderValue_Boolean(reader, "Inactive", false);
                    obj.TeamNo      = GetReaderValue_NullableInt32(reader, "TeamNo", 0);
                    obj.DivisionNo  = GetReaderValue_NullableInt32(reader, "DivisionNo", 0);
                    obj.Salesman    = GetReaderValue_NullableInt32(reader, "Salesman", 0);
                    obj.ClientNo    = GetReaderValue_Int32(reader, "ClientNo", 0);
                    return(obj);
                }
                else
                {
                    return(null);
                }
            }
            catch (SqlException sqlex)
            {
                //LogException(sqlex);
                throw new Exception("Failed to get Contact", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
コード例 #10
0
        private JobAd CreateNewJobAd(string adContent, JobAdStatus adStatus, IHasId <Guid> adPoster,
                                     bool adHideContactDetails, ContactDetails adContactDetails, string summary, string bulletpoint1, string bulletpoint2,
                                     string bulletpoint3, FileReference logoImg, string adTitle, string positionTitle,
                                     JobTypes jobtypes, bool isResidenacyRequired, string externalRef, string maxsalary,
                                     string minsalary, string package, IList <Industry> reqIndustries, string companyname,
                                     LocationReference jobLocation, DateTime expiryDate)
        {
            var salary       = SalaryExtensions.Parse(minsalary, maxsalary, SalaryRate.Year, true);
            var bulletPoints = new[] { bulletpoint1, bulletpoint2, bulletpoint3 };

            var newJobAd = new JobAd
            {
                Status     = adStatus,
                PosterId   = adPoster.Id,
                Visibility =
                {
                    HideContactDetails = adHideContactDetails,
                    HideCompany        = false,
                },
                ContactDetails = adContactDetails,
                Title          = adTitle,
                Integration    = { ExternalReferenceId = externalRef },
                LogoId         = logoImg == null ? (Guid?)null : logoImg.Id,
                ExpiryTime     = expiryDate,
                Description    =
                {
                    CompanyName       = companyname,
                    Content           = adContent,
                    PositionTitle     = positionTitle,
                    ResidencyRequired = isResidenacyRequired,
                    JobTypes          = jobtypes,
                    Industries        = reqIndustries,
                    Summary           = summary,
                    Salary            = salary,
                    Package           = package,
                    BulletPoints      = bulletPoints,
                    Location          = jobLocation,
                }
            };

            _jobAdsCommand.CreateJobAd(newJobAd);
            _jobAdsCommand.OpenJobAd(newJobAd);

            return(newJobAd);
        }
コード例 #11
0
        private void LoadRecord()
        {
            Int64          iID        = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"], Session.SessionID));
            Contacts       clsContact = new Contacts();
            ContactDetails clsDetails = clsContact.Details(iID);

            clsContact.CommitAndDispose();

            lblContactID.Text            = clsDetails.ContactID.ToString();
            txtContactCode.Text          = clsDetails.ContactCode;
            txtContactName.Text          = clsDetails.ContactName;
            cboGroup.SelectedIndex       = cboGroup.Items.IndexOf(cboGroup.Items.FindByValue(clsDetails.ContactGroupID.ToString()));
            cboModeOfTerms.SelectedIndex = cboModeOfTerms.Items.IndexOf(cboModeOfTerms.Items.FindByValue(clsDetails.ModeOfTerms.ToString("d")));
            txtTerms.Text               = clsDetails.Terms.ToString("###0");
            txtAddress.Text             = clsDetails.Address;
            txtBusinessName.Text        = clsDetails.BusinessName;
            txtTelephoneNo.Text         = clsDetails.TelephoneNo;
            txtRemarks.Text             = clsDetails.Remarks;
            txtDebit.Text               = clsDetails.Debit.ToString("###0.#0");
            chkIsCreditAllowed.Checked  = clsDetails.IsCreditAllowed;
            cboDepartment.SelectedIndex = cboDepartment.Items.IndexOf(cboDepartment.Items.FindByValue(clsDetails.DepartmentID.ToString()));
            cboPosition.SelectedIndex   = cboPosition.Items.IndexOf(cboPosition.Items.FindByValue(clsDetails.PositionID.ToString()));

            txtCreditCardNo.Text            = clsDetails.CreditDetails.CreditCardNo;
            cboCreditCardType.SelectedIndex = cboCreditCardType.Items.IndexOf(cboCreditCardType.Items.FindByValue(clsDetails.CreditDetails.CardTypeDetails.CardTypeID.ToString()));
            txtCreditAwardDate.Text         = clsDetails.CreditDetails.CreditAwardDate.ToString("yyyy-MMM-dd");
            txtExpiryDate.Text = clsDetails.CreditDetails.ExpiryDate.ToString("yyyy-MMM-dd");
            cboCreditCardStatus.SelectedIndex = cboCreditCardStatus.Items.IndexOf(cboCreditCardStatus.Items.FindByValue(clsDetails.CreditDetails.CreditCardStatus.ToString("d")));
            lblCreditCardActive.Text          = clsDetails.CreditDetails.CreditActive ? "Active" : "InActive (Hold/Suspended)";
            txtCreditLimit.Text     = clsDetails.CreditLimit.ToString("###0.#0");
            txtCredit.Text          = clsDetails.Credit.ToString("###0.#0");
            txtPaidAmount.Text      = "0.00";
            txtCurrentBalance.Text  = (clsDetails.CreditLimit - clsDetails.Credit).ToString("###0.#0");
            lblLastBillingDate.Text = "Last Billing Date:" + clsDetails.CreditDetails.LastBillingDate.ToString("yyyy-MMM-dd");

            // 26Oct2014 - add the additional information
            cboSalutation.SelectedIndex = cboSalutation.Items.IndexOf(cboSalutation.Items.FindByValue(clsDetails.AdditionalDetails.Salutation));
            txtFirstName.Text           = clsDetails.AdditionalDetails.FirstName;
            txtMiddleName.Text          = clsDetails.AdditionalDetails.MiddleName;
            txtLastName.Text            = clsDetails.AdditionalDetails.LastName;
            txtBirthDate.Text           = clsDetails.AdditionalDetails.BirthDate.ToString("yyyy-MM-dd");
            txtMobileNo.Text            = clsDetails.AdditionalDetails.MobileNo;

            LoadPurchases(clsDetails.ContactID);
        }
コード例 #12
0
ファイル: Users.cs プロジェクト: dineshcesltd/Registration
 /// <summary>
 /// gets user address
 /// </summary>
 /// <param name="Email"> user email </param>
 /// <returns> Contact Details model </returns>
 public ContactDetails getAddress(string Id)
 {
     using (var _ctx = new ChinmayaEntities())
     {
         ContactDetails cd    = new ContactDetails();
         var            aData = _ctx.Users.Where(f => f.Email == Id).FirstOrDefault();
         if (aData != null)
         {
             cd.Address   = aData.Address;
             cd.City      = aData.City;
             cd.State     = aData.StateId;
             cd.Country   = aData.CountryId;
             cd.ZipCode   = aData.ZipCode;
             cd.HomePhone = aData.HomePhone;
         }
         return(cd);
     }
 }
コード例 #13
0
        public ContactDetails SelectContact(int contactID)
        {
            ContactDetails        selectedContact = new ContactDetails();
            var                   cDb             = GetContactDB();
            List <ContactDetails> allConts        = cDb.ContactList;
            var                   obj             = allConts.FirstOrDefault(x => x.ContactID == contactID);

            if (obj != null)
            {
                selectedContact.ContactID   = contactID;
                selectedContact.FirstName   = obj.FirstName;
                selectedContact.LastName    = obj.LastName;
                selectedContact.PhoneNumber = obj.PhoneNumber;
                selectedContact.Email       = obj.Email;
                selectedContact.Status      = obj.Status;
            }
            return(selectedContact);
        }
コード例 #14
0
        internal void AddAdditionalContacts(int contacts)
        {
            for (int i = 0; i < contacts; i++)
            {
                basicDetailsObjects.AddAdditionalContact.Click();

                _wait.Until(ExpectedConditions.ElementToBeClickable(By.Id($"solution.contacts[{i + 1}].contactType")));

                ContactDetails details = TestDataGenerator.GenerateTestContact();

                // Due to having to replace part of the ID, this cannot be placed into the object model
                _driver.FindElement(By.Id($"solution.contacts[{i + 1}].contactType")).SendKeys(details.JobTitle);
                _driver.FindElement(By.Id($"solution.contacts[{i + 1}].firstName")).SendKeys(details.FirstName);
                _driver.FindElement(By.Id($"solution.contacts[{i + 1}].lastName")).SendKeys(details.LastName);
                _driver.FindElement(By.Id($"solution.contacts[{i + 1}].emailAddress")).SendKeys(details.EmailAddress);
                _driver.FindElement(By.Id($"solution.contacts[{i + 1}].phoneNumber")).SendKeys(details.PhoneNumber);
            }
        }
コード例 #15
0
        /// <summary>
        /// This method is used to save Contact Details List
        /// </summary>
        /// <param name="i_sConnectionString"></param>
        /// <param name="i_objPreclearanceRequestNonImplCompanyDTO"></param>
        /// <returns></returns>
        public ContactDetails InsertUpdatecontactDetails(string i_sConnectionString, DataTable dt_ContactDetails)
        {
            ContactDetails objContactDetailsDTO = null;

            try
            {
                using (var objUserInfoDAL = new InsiderTradingDAL.UserInfoDAL())
                {
                    objContactDetailsDTO = objUserInfoDAL.InsertUpdatecontactDetails(i_sConnectionString, dt_ContactDetails);
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(objContactDetailsDTO);
        }
コード例 #16
0
        public async Task <IActionResult> PutContactDetails(int id, ContactDetails contactDetails)
        {
            var result = (RepositoryResultTypes)(await _contactRepo.UpdateAsync(id, contactDetails));


            switch (result)
            {
            case RepositoryResultTypes.BadRequest: return(BadRequest());

            case RepositoryResultTypes.NotFound: return(NotFound());

            case RepositoryResultTypes.Error: throw new DbUpdateConcurrencyException();

            case RepositoryResultTypes.NoContent: return(NoContent());
            }

            return(NoContent());
        }
コード例 #17
0
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var model = new ContactDetails();

            model.Contact = await db.Contacts.FindAsync(id);

            model.History = await db.Histories.Where(h => h.UserId == id).OrderByDescending(h => h.Time).ToListAsync();

            if (model.Contact == null)
            {
                return(HttpNotFound());
            }
            return(View(model));
        }
コード例 #18
0
        public string Post(ContactDetails contactDetails)
        {
            try
            {
                DataTable table = new DataTable();

                string query = @"INSERT INTO [dbo].ContactDetails ([FirstName],[LastName], [Email],[PhoneNo],[Status]) VALUES  ('" + contactDetails.FirstName + "', '" + contactDetails.LastName + "','" + contactDetails.Email + "','" + contactDetails.PhoneNo + "','" + contactDetails.Status + "')";
                using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ContactAPPDB"].ConnectionString))
                {
                    connection.Execute(query);
                }
                return("added Sucessfully");
            }
            catch
            {
                return("Failed to add");
            }
        }
コード例 #19
0
 protected static void ValidateJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, JobResource getJob)
 {
     Assert.NotNull(getJob.Details);
     Assert.NotNull(getJob.Details.ContactDetails.NotificationPreference);
     Assert.Equal(contactDetails.ContactName, getJob.Details.ContactDetails.ContactName);
     Assert.Equal(contactDetails.Phone, getJob.Details.ContactDetails.Phone);
     Assert.Equal(contactDetails.PhoneExtension, getJob.Details.ContactDetails.PhoneExtension);
     Assert.Equal(contactDetails.EmailList, getJob.Details.ContactDetails.EmailList);
     Assert.Equal(shippingAddress.AddressType, getJob.Details.ShippingAddress.AddressType);
     Assert.Equal(shippingAddress.City, getJob.Details.ShippingAddress.City);
     Assert.Equal(shippingAddress.CompanyName, getJob.Details.ShippingAddress.CompanyName);
     Assert.Equal(shippingAddress.Country, getJob.Details.ShippingAddress.Country);
     Assert.Equal(shippingAddress.PostalCode, getJob.Details.ShippingAddress.PostalCode);
     Assert.Equal(shippingAddress.StateOrProvince, getJob.Details.ShippingAddress.StateOrProvince);
     Assert.Equal(shippingAddress.StreetAddress1, getJob.Details.ShippingAddress.StreetAddress1);
     Assert.Equal(shippingAddress.StreetAddress2, getJob.Details.ShippingAddress.StreetAddress2);
     Assert.Equal(shippingAddress.StreetAddress3, getJob.Details.ShippingAddress.StreetAddress3);
 }
コード例 #20
0
ファイル: AgencyController.cs プロジェクト: Alex-901/CRM
        public ActionResult SaveContact(ContactDetails contact)
        {
            try
            {
                var agencyBusiness = new AgencyBusiness();

                agencyBusiness.SaveContactDetail(contact);

                var contacts = agencyBusiness.LoadContactDetails(CRMEngine.Constants.Enums.ContactDetailType.Agency, contact.EntityId);

                return(PartialView("~/Views/Shared/EditorTemplates/ContactDetails.cshtml", contacts));
            }
            catch (Exception ex)
            {
                Functions.EventHandler(ex, "SaveContact(contact)");
                return(View());
            }
        }
コード例 #21
0
ファイル: Mappings.cs プロジェクト: formist/LinkMe
        public static void MapPhoneNumber(this ContactDetails contact, bool hideContactDetails, out string phoneAreaCode, out string phoneLocalNumber)
        {
            phoneAreaCode    = "00";
            phoneLocalNumber = "00000000";

            if (contact == null || hideContactDetails || string.IsNullOrEmpty(contact.PhoneNumber))
            {
                return;
            }

            var phoneNumber = new StringBuilder(contact.PhoneNumber);

            phoneNumber.Replace(" ", string.Empty);
            phoneNumber.Replace("(", string.Empty);
            phoneNumber.Replace(")", string.Empty);
            phoneNumber.Replace("-", string.Empty);

            if (phoneNumber[0] != '+')
            {
                ParseFnn(phoneNumber.ToString(), contact.PhoneNumber, out phoneAreaCode, out phoneLocalNumber);
            }
            else
            {
                if (phoneNumber.Length <= 3)
                {
                    throw new ArgumentException(string.Format("'{0}' is an invalid phone number.", contact.PhoneNumber));
                }

                if (phoneNumber[1] != '6' || phoneNumber[2] != '1')
                {
                    throw new ArgumentException(string.Format("'{0}' is not an Australian phone number.",
                                                              contact.PhoneNumber));
                }

                phoneNumber.Remove(0, 3); // remove country code

                if (phoneNumber[0] != '1' && phoneNumber[0] != '0')
                {
                    phoneNumber.Insert(0, '0');
                }

                ParseFnn(phoneNumber.ToString(), contact.PhoneNumber, out phoneAreaCode, out phoneLocalNumber);
            }
        }
コード例 #22
0
        public async Task <ActionResult> ContactDetails(ContactDetails data, string prevBtn, string nextBtn)
        {
            UserModel obj = GetUser();

            ViewBag.CountryList = await _common.GetCountryData();

            ViewBag.SelectedCountry = await _account.GetCountryId("United States");

            if (prevBtn != null)
            {
                PersonalDetails pd = new PersonalDetails();
                pd.FirstName    = obj.FirstName;
                pd.LastName     = obj.LastName;
                pd.DOB          = obj.DOB;
                pd.GenderData   = obj.GenderId;
                pd.AgeGroupData = (int)obj.AgeGroupId;
                ViewBag.Gender  = await _common.GetGenderData();

                ViewBag.SelectedGender = obj.GenderId;
                ViewBag.AgeGroup       = await _common.GetAgeGroupData();

                ViewBag.SelectedAgeGroup = (int)obj.AgeGroupId;
                return(RedirectToAction("PersonalDetails", pd));
            }

            if (nextBtn != null)
            {
                if (ModelState.IsValid)
                {
                    obj.Address   = data.Address;
                    obj.CountryId = data.Country;
                    obj.StateId   = data.State;
                    obj.City      = data.City;
                    obj.ZipCode   = data.ZipCode;
                    obj.HomePhone = data.HomePhone;
                    obj.CellPhone = data.CellPhone;
                    AccountDetails Ad = new AccountDetails();
                    Ad.SecurityQuestionsModel = await _common.GetSecurityQuestions();

                    return(RedirectToAction("AccountDetails"));
                }
            }
            return(View());
        }
コード例 #23
0
        public async Task OnLogin_WhenProfileComplete_RedirectToDashboard()
        {
            var portFreightUser = new PortFreightUser()
            {
                UserName     = "******",
                Email        = "*****@*****.**",
                PasswordHash = "TestTest1!",
                SenderId     = "T12345"
            };

            portFreightUsersList = new List <PortFreightUser>();
            portFreightUsersList.Add(portFreightUser);

            loginModel.Input = new LoginModel.InputModel
            {
                Email      = portFreightUser.Email,
                Password   = portFreightUser.PasswordHash,
                RememberMe = true
            };

            mockfakeSignInManager.Setup(x => x.PasswordSignInAsync(loginModel.Input.Email, loginModel.Input.Password, loginModel.Input.RememberMe, true)).ReturnsAsync(Microsoft.AspNetCore.Identity.SignInResult.Success);

            mockUserManager.Setup(u => u.FindByEmailAsync(It.IsAny <string>())).ReturnsAsync(portFreightUsersList.FirstOrDefault());

            var ContactDetails = new ContactDetails {
                SenderId = "T12345"
            };
            await actualContext.ContactDetails.AddAsync(ContactDetails);

            actualContext.SaveChanges();

            var SenderType = new SenderType {
                SenderId = "T12345"
            };
            await actualContext.SenderType.AddAsync(SenderType);

            actualContext.SaveChanges();

            var result = (RedirectToPageResult)await loginModel.OnPostAsync();

            Assert.IsNotNull(result);
            Assert.AreEqual("/Dashboard", result.PageName);
            Assert.IsInstanceOfType(result, typeof(RedirectToPageResult));
        }
コード例 #24
0
ファイル: CoreClient.cs プロジェクト: gitter-badger/accounts
        public Response<object> UpdateContactDetails(string id, ContactDetails contactDetails)
        {
            var contactString = JsonConvert.SerializeObject(contactDetails,
                Formatting.None,
                new JsonSerializerSettings()
                {
                    ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
                });

            var content = new StringContent(contactString, Encoding.UTF8, "application/json");

            // call sync
            var response = _client.PatchAsync("/users/" + id, content).Result;
            if (response.IsSuccessStatusCode)
            {
                return new Response<object>{ Errored = false };
            }
            return new Response<object> { Errored = true, ErrorMessage = "Error Occurred"};
        }
コード例 #25
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            return;
        }


        if (Session["ContactDetails"] != null)
        {
            this._contactDetails = (ContactDetails)Session["ContactDetails"];
            this.DisplayReservation();
        }
        else if (Request.Cookies["FirstName"] != null && Request.Cookies["LastName"] != null)
        {
            this.txtFirstName.Text = Request.Cookies["FirstName"].Value;
            this.txtLastName.Text  = Request.Cookies["LastName"].Value;
        }
    }
コード例 #26
0
ファイル: HideJobAdTests.cs プロジェクト: formist/LinkMe
        protected void AssertHide(string expectedCompanyName, ContactDetails expectedContactDetails, JobAdFeedElement jobAdFeed)
        {
            Assert.AreEqual(expectedCompanyName, jobAdFeed.EmployerCompanyName);

            if (expectedContactDetails == null)
            {
                Assert.IsNull(jobAdFeed.ContactDetails);
                Assert.AreEqual(null, jobAdFeed.RecruiterCompanyName);
            }
            else
            {
                Assert.AreEqual(expectedContactDetails.FirstName, jobAdFeed.ContactDetails.FirstName);
                Assert.AreEqual(expectedContactDetails.LastName, jobAdFeed.ContactDetails.LastName);
                Assert.AreEqual(expectedContactDetails.EmailAddress, jobAdFeed.ContactDetails.EmailAddress);
                Assert.AreEqual(expectedContactDetails.FaxNumber, jobAdFeed.ContactDetails.FaxNumber);
                Assert.AreEqual(expectedContactDetails.PhoneNumber, jobAdFeed.ContactDetails.PhoneNumber);
                Assert.AreEqual(expectedContactDetails.CompanyName, jobAdFeed.RecruiterCompanyName);
            }
        }
コード例 #27
0
        public ActionResult Index()
        {
            ContactDetails        contact    = new ContactDetails();
            List <ContactDetails> lstcontact = new List <ContactDetails>();
            DataTable             dtcontact  = ContactRepository.GetContactsDetails();

            foreach (DataRow dr in dtcontact.Rows)
            {
                lstcontact.Add(new ContactDetails
                {
                    ID        = Convert.ToInt32(dr["ID"]),
                    FirstName = Convert.ToString(dr["FirstName"]),
                    Lastname  = Convert.ToString(dr["LastName"]),
                    Address   = Convert.ToString(dr["Address"]),
                    Phone     = Convert.ToString(dr["Phone"])
                });
            }
            return(View(lstcontact));
        }
コード例 #28
0
        private Client CreateClient(ClientRequest request)
        {
            Client client = new Client();

            client.Id        = Guid.NewGuid();
            client.Title     = request.Title;
            client.FirstName = request.FirstName;
            client.LastName  = request.LastName;
            client.Email     = request.Email;

            ContactDetails contactDetails = new ContactDetails()
            {
                PhoneType   = request.ContactDetails.PhoneType,
                PhoneNumber = request.ContactDetails.PhoneNumber
            };

            client.ContactDetails = contactDetails;
            return(client);
        }
コード例 #29
0
        public IActionResult AddTaskInformation([FromForm] GetTaskInformation c)
        {
            ContactDetails cdetails = new ContactDetails();

            // cdetails.ContactId = c.ContactId;
            cdetails.Name                = c.Name;
            cdetails.Number1             = c.Contact1;
            cdetails.Number2             = c.Contact2;
            cdetails.Address             = c.Address;
            cdetails.ContactDescription  = c.ContactDescription;
            cdetails.ContactDetailId     = c.ContactId;
            cdetails.ContactId.ContactId = c.ContactId;

            int contactId = _contactService.AddContactDetail(cdetails);

            if (contactId != 0)

            {
                TaskInformation taskinfo = new TaskInformation();
                taskinfo.ContactId.ContactId = contactId;
                taskinfo.InfoDescription     = c.InfoDescription;
                taskinfo.Id.Id      = c.EmpId;
                taskinfo.IsComplete = c.IsComplete;

                _service.AddTaskInformation(taskinfo);
                return(Ok(c));
            }
            else
            {
                return(BadRequest("error"));
            }


            /* if (_service.AddContactDetail(c))
             * {
             *
             *   return Ok(c);
             * }
             * else
             * {
             *   return BadRequest("error");
             * }*/
        }
コード例 #30
0
        public ActionResult DeleteContact(Guid contactId)
        {
            ContactDetails cd = new ContactDetails();

            if (contactId == Guid.Empty)
            {
                cd = ReLoad(cd);
            }
            else
            {
                string checkMessage = "";
                //Remove in DB
                checkMessage    = _deleteContact.DeleteContactDetails(contactId);
                ViewBag.Message = checkMessage;

                cd = ReLoad(cd);
            }
            return(PartialView("_ContactsList", cd));
        }
コード例 #31
0
        public static ContactDetailsResponseObject ToResponse(this ContactDetails domain)
        {
            if (null == domain)
            {
                return(null);
            }

            return(new ContactDetailsResponseObject
            {
                Id = domain.Id,
                TargetId = domain.TargetId,
                TargetType = domain.TargetType,
                ContactInformation = domain.ContactInformation,
                CreatedBy = domain.CreatedBy,
                IsActive = domain.IsActive,
                RecordValidUntil = domain.RecordValidUntil,
                SourceServiceArea = domain.SourceServiceArea
            });
        }
コード例 #32
0
 private static void AssertContactDetails(ContactDetails expectedContactDetails, ContactDetails contactDetails)
 {
     if (expectedContactDetails == null)
     {
         Assert.IsNull(contactDetails);
     }
     else
     {
         Assert.IsNotNull(contactDetails);
         Assert.AreEqual(expectedContactDetails.Id, contactDetails.Id);
         Assert.AreEqual(expectedContactDetails.FirstName, contactDetails.FirstName);
         Assert.AreEqual(expectedContactDetails.LastName, contactDetails.LastName);
         Assert.AreEqual(expectedContactDetails.CompanyName, contactDetails.CompanyName);
         Assert.AreEqual(expectedContactDetails.EmailAddress, contactDetails.EmailAddress);
         Assert.AreEqual(expectedContactDetails.SecondaryEmailAddresses, contactDetails.SecondaryEmailAddresses);
         Assert.AreEqual(expectedContactDetails.FaxNumber, contactDetails.FaxNumber);
         Assert.AreEqual(expectedContactDetails.PhoneNumber, contactDetails.PhoneNumber);
     }
 }
コード例 #33
0
        public static Company Create(ISettings settings)
        {
            Company company = new Company();

            if (!settings.IgnoreStringLengthConditions)
            {
                company.CompanyName   = RandomHelper.CreateRandomString(string.Empty, 1, 50); //255?
                company.CompanyNumber = RandomHelper.CreateRandomStringOfNumbers(8, 8);
            }
            else
            {
                company.CompanyName   = RandomHelper.CreateRandomString(string.Empty, 0, 1000);
                company.CompanyNumber = RandomHelper.CreateRandomStringOfNumbers(0, 1000);
            }

            company.RegisteredOffice = ContactDetails.Create(settings, true);

            return(company);
        }
コード例 #34
0
        public void Initialise(ConnectionInformation connectionInformation)
        {
            SlackKey       = connectionInformation.SlackKey;
            Team           = connectionInformation.Team;
            Self           = connectionInformation.Self;
            _userNameCache = connectionInformation.Users;
            _connectedHubs = connectionInformation.SlackChatHubs;

            _webSocketClient          = connectionInformation.WebSocket;
            _webSocketClient.OnClose += (sender, args) =>
            {
                ConnectedSince = null;
                RaiseOnDisconnect();
            };

            _webSocketClient.OnMessage += async(sender, message) => await ListenTo(message);

            ConnectedSince = DateTime.Now;
        }
コード例 #35
0
        public ActionResult SaveEditContact(EditModalView viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { isValid = false, view = RenderViewAsString("_UpdateContact", viewModel) }));
            }

            string _checkMessage = "";

            //storing in DB
            _checkMessage   = _updateContact.SaveEditContact(viewModel);
            ViewBag.Message = _checkMessage;

            ContactDetails cd = new ContactDetails();

            cd = ReLoad(cd);

            return(Json(new { isValid = true, view = RenderViewAsString("_ContactsList", cd) }));
        }
コード例 #36
0
ファイル: UserService.cs プロジェクト: yanoovoni/Rdroid
    public bool IfContactExist(ContactDetails contactDetais)//הפעולה בודקת האם איש הקשר כבר קיים
    {
        bool find = false;
        object obj = null;
        OleDbCommand myCmd = new OleDbCommand("checkIfContactExistsByUserPhoneBelong", myConnection);
        myCmd.CommandType = CommandType.StoredProcedure;
        OleDbParameter objParam;

        objParam = myCmd.Parameters.Add("@UserPhoneBelong", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.userPhoneBelong;

        objParam = myCmd.Parameters.Add("@PhoneNumber", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.phoneNumber;

        try
        {
            myConnection.Open();
            obj = myCmd.ExecuteScalar();
            if (obj == null)
                return find;
            find = true;
            return find;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            myConnection.Close();
        }

       
    }
コード例 #37
0
        private void PopulateContactDetails(ContactDetails contactDetails, XElement xmlContactDetails)
        {
            XElement xmlTitle = new XElement(XmlNamespace.MemberRegistration + "title");
            xmlContactDetails.Add(xmlTitle);
            xmlTitle.Value = contactDetails.Title ?? string.Empty;

            XElement xmlForename = new XElement(XmlNamespace.MemberRegistration + "forename");
            xmlContactDetails.Add(xmlForename);
            xmlForename.Value = contactDetails.Forename ?? string.Empty;

            XElement xmlSurname = new XElement(XmlNamespace.MemberRegistration + "surname");
            xmlContactDetails.Add(xmlSurname);
            xmlSurname.Value = contactDetails.Surname ?? string.Empty;

            XElement xmlPhoneLandLind = new XElement(XmlNamespace.MemberRegistration + "phoneLandLine");
            xmlContactDetails.Add(xmlPhoneLandLind);
            xmlPhoneLandLind.Value = contactDetails.PhoneLandLine ?? string.Empty;

            XElement xmlPhoneMobile = new XElement(XmlNamespace.MemberRegistration + "phoneMobile");
            xmlContactDetails.Add(xmlPhoneMobile);
            xmlPhoneMobile.Value = contactDetails.PhoneMobile ?? string.Empty;

            XElement xmlFax = new XElement(XmlNamespace.MemberRegistration + "fax");
            xmlContactDetails.Add(xmlFax);
            xmlFax.Value = contactDetails.Fax ?? string.Empty;

            XElement xmlEmail = new XElement(XmlNamespace.MemberRegistration + "email");
            xmlContactDetails.Add(xmlEmail);
            xmlEmail.Value = contactDetails.Email ?? string.Empty;

            XElement xmlAddress = new XElement(XmlNamespace.MemberRegistration + "address");
            xmlContactDetails.Add(xmlAddress);
            PopulateAddress(contactDetails.Address, xmlAddress);
        }
コード例 #38
0
ファイル: Reference.cs プロジェクト: AlineGuan/odata.net
 partial void OnPrimaryContactInfoChanging(ContactDetails value);
コード例 #39
0
ファイル: Reference.cs プロジェクト: AlineGuan/odata.net
 partial void OnComplexContactDetailsChanging(ContactDetails value);
コード例 #40
0
ファイル: Reference.cs プロジェクト: larsenjo/odata.net
 public static ContactDetails CreateContactDetails(global::System.DateTimeOffset lastContacted, global::System.DateTimeOffset contacted, global::System.Guid gUID, global::System.TimeSpan preferedContactTime, byte @byte, sbyte signedByte, double @double, float single, short @short, int @int, long @long)
 {
     ContactDetails contactDetails = new ContactDetails();
     contactDetails.LastContacted = lastContacted;
     contactDetails.Contacted = contacted;
     contactDetails.GUID = gUID;
     contactDetails.PreferedContactTime = preferedContactTime;
     contactDetails.Byte = @byte;
     contactDetails.SignedByte = signedByte;
     contactDetails.Double = @double;
     contactDetails.Single = single;
     contactDetails.Short = @short;
     contactDetails.Int = @int;
     contactDetails.Long = @long;
     return contactDetails;
 }
コード例 #41
0
 public ActionResult Index(ContactDetails.Models.ContactDetails details)
 {
     return View(details);
 }
コード例 #42
0
 /// <summary>
 /// Initializes the child objects associated with this EndPoint.
 /// </summary>
 protected virtual void InitObjects()
 {
     Destination = new ContactDetails();
     Signoff = new Signature();
 }
コード例 #43
0
        private static Jobs GetMultiDropJobs()
        {
            var customer = new ContactDetails
            {
                // Customer address details
            };

            var pickupEndPoint = new EndPoint
            {
                RequestedDate = DateTime.Today,
                RequestedDateIsExact = false,
                Destination = new ContactDetails
                {
                    // Pickup address details
                }
            };

            var drop1EndPoint = new EndPoint
            {
                RequestedDate = DateTime.Today + TimeSpan.FromDays(3),
                Destination = new ContactDetails
                {
                    // Drop 1 address details
                }
            };

            var drop2EndPoint = new EndPoint
            {
                RequestedDate = DateTime.Today + TimeSpan.FromDays(3),
                Destination = new ContactDetails
                {
                    // Drop 2 address details
                }
            };

            var drop1Job = new Job
            {
                LoadId = "Drop1",
                CustomerReference = "LoadA",
                Customer = customer,
                Pickup = pickupEndPoint,
                Dropoff = drop1EndPoint,
                Vehicles = new List<Vehicle>
                {
                    new Vehicle{ Vin = "Vehicle111" },
                    new Vehicle{ Vin = "Vehicle222" }
                }
            };

            var drop2Job = new Job
            {
                LoadId = "Drop2",
                CustomerReference = "LoadA",
                Customer = customer,
                Pickup = pickupEndPoint,
                Dropoff = drop2EndPoint,
                Vehicles = new List<Vehicle>
                {
                    new Vehicle{ Vin = "Vehicle333" },
                }
            };

            return new Jobs { drop1Job, drop2Job };
        }
コード例 #44
0
 public ActionResult Continue(ContactDetails contactDetails)
 {
     return Redirect(EndPoints.PeopleCloudAddress);
 }
コード例 #45
0
ファイル: WebService.cs プロジェクト: yanoovoni/Rdroid
 public void InsertContact(ContactDetails contactDetais)//הפעולה מאפשרת להוסיף מידע לתוך טבלת אנשי הקשר
 {
     UserService service = new UserService();
     service.IfContactExist(contactDetais);
 }
コード例 #46
0
ファイル: WebService.cs プロジェクト: yanoovoni/Rdroid
 public bool IfContactExist(ContactDetails contactDetais)//הפעולה בודקת האם איש הקשר כבר קיים
 {
     UserService service = new UserService();
     return service.IfContactExist(contactDetais);
 }
コード例 #47
0
ファイル: UserService.cs プロジェクト: yanoovoni/Rdroid
    public void InsertContact( ContactDetails contactDetais)//הפעולה מאפשרת להוסיף מידע לתוך טבלת אנשי הקשר
    {
        OleDbCommand myCmd = new OleDbCommand("InsertIntoContacts", myConnection);
        myCmd.CommandType = CommandType.StoredProcedure;
        //INSERT INTO Contacts ( UserIDBelong, PhoneNumber, FirstName, LastName, Email )
       // VALUES(@UserIDBelong, @PhoneNumber, @FirstName, @LastName, @Email);

        OleDbParameter objParam;

        objParam = myCmd.Parameters.Add("@UserPhoneBelong", OleDbType.Integer);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.userPhoneBelong;

        objParam = myCmd.Parameters.Add("@PhoneNumber", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.phoneNumber;

        objParam = myCmd.Parameters.Add("@FirstName", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.firstName;

        objParam = myCmd.Parameters.Add("@LastName", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.lastName;

        objParam = myCmd.Parameters.Add("@Email", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.email;
        objParam = myCmd.Parameters.Add("@Status", OleDbType.BSTR);
        objParam.Direction = ParameterDirection.Input;
        objParam.Value = contactDetais.status;
        try
        {
            myConnection.Open();
            myCmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            myConnection.Close();
        }
    }
コード例 #48
0
ファイル: UserService.cs プロジェクト: yanoovoni/Rdroid
    public ContactDetails GetContactsByID(int IDmy)//הפעולה מחזירה פרטי איש קשר על פי מספרו בטבלה
    {
        OleDbCommand myCmd = new OleDbCommand("ReturnContactByID", myConnection);
        myCmd.CommandType = CommandType.StoredProcedure;
        OleDbDataReader reader;
        DataSet dataset = new DataSet();
        ContactDetails contact = new ContactDetails();
        
        OleDbParameter parameter;
        parameter = myCmd.Parameters.Add("@ID", OleDbType.BSTR);
        parameter.Direction = ParameterDirection.Input;
        parameter.Value = IDmy;

        try
        {
            myConnection.Open();
            reader = myCmd.ExecuteReader();
            while (reader.Read())
            {
                contact.id = IDmy;
                contact.phoneNumber = reader["PhoneNumber"].ToString();
                contact.firstName = reader["FirstName"].ToString();
                contact.lastName = reader["LastName"].ToString();
                contact.email = reader["Email"].ToString();
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            myConnection.Close();
        }
        return contact;
    }
コード例 #49
0
 public ChargePaymentRequest() { ContactDetails = new ContactDetails(); }
コード例 #50
0
		public List<ContactDetail> Get(ContactDetails request)
		{
			return GetContacts();
		}
コード例 #51
0
ファイル: ContactInfoMonitor.cs プロジェクト: Irdis/VSTalk
 public void SetResult(ContactDetails latest)
 {
 }