Beispiel #1
0
        /// <summary>
        /// get smtp details for mail sending
        /// </summary>
        /// <param name="emailTo">email will send to</param>
        /// <param name="password">password </param>
        /// <param name="body">message body</param>
        public static void GetSmtpDetail(string emailTo, string body, string subject)
        {
            try
            {
                DecisionPointRepository objdecisionPointRepository = new DecisionPointRepository();
                // return objdecisionPointRepository.Getsmtpdetails();
                DecisionPointMailMatixBAL.Request.SMTPDetail objSMTPDetail = new DecisionPointMailMatixBAL.Request.SMTPDetail();//objdecisionPointRepository.Getsmtpdetails();

                //Set Mail credentials
                BusinessEmail objBusinessEmail = new BusinessEmail();
                objBusinessEmail.EmailBody           = body;
                objBusinessEmail.EmailFrom           = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServer;//objSMTPDetail.EmailSmtpServer;
                objBusinessEmail.EmailTo             = emailTo;
                objBusinessEmail.EmailSubject        = subject;
                objBusinessEmail.EmailSmtpServerHost = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServerHost;
                objBusinessEmail.EmailSmtpServerPort = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServerPort;
                objBusinessEmail.EmailSmtpServerSSL  = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServerSSL;
                objBusinessEmail.EmailPassword       = objdecisionPointRepository.Getsmtpdetails().PasswordSmtpServer;
                objBusinessEmail.PasswordSmtpServer  = objdecisionPointRepository.Getsmtpdetails().PasswordSmtpServer;
                objBusinessEmail.EmailSmtpServer     = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServer;
                SendMail(objBusinessEmail);
            }
            catch
            {
                throw;
            }
        }
Beispiel #2
0
 /// <summary>
 /// method to send new password through Email
 /// </summary>
 /// <param name="businessEmail"></param>
 public static void SendMail(BusinessEmail businessEmail)
 {
     try
     {
         using (MailMessage mail = new MailMessage())
         {
             using (SmtpClient SmtpServer = new SmtpClient(businessEmail.EmailSmtpServerHost))
             {
                 mail.From = new MailAddress(businessEmail.EmailFrom);
                 mail.To.Add(businessEmail.EmailTo);
                 mail.Subject           = businessEmail.EmailSubject;
                 mail.Body              = businessEmail.EmailBody;
                 mail.IsBodyHtml        = true;
                 mail.Priority          = MailPriority.High;
                 SmtpServer.Port        = businessEmail.EmailSmtpServerPort;
                 SmtpServer.Credentials = new System.Net.NetworkCredential(businessEmail.EmailSmtpServer, businessEmail.PasswordSmtpServer);
                 SmtpServer.EnableSsl   = businessEmail.EmailSmtpServerSSL;
                 SmtpServer.Send(mail);
             }
         }
     }
     catch
     {
         throw;
     }
 }
        public IHttpActionResult PutBusinessEmail(int id, BusinessEmail businessEmail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != businessEmail.BusinessEmailID)
            {
                return(BadRequest());
            }

            try
            {
                db.UpdateBusinessEmail(id, businessEmail);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BusinessEmailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="BusinessEmailDTO"/> converted from <see cref="BusinessEmail"/>.</param>
 static partial void OnDTO(this BusinessEmail entity, BusinessEmailDTO dto)
 {
     if (entity != null && entity.Email != null)
     {
         dto.Email = EmailAssembler.ToDTO(entity.Email);
     }
 }
        public BusinessEmail Create(BusinessEmail oBusinessEmails)
        {
            if (oBusinessEmails != null)
            {
                return(oBusinessEmailsRepos.CreateBusinessEmail(oBusinessEmails));
            }

            return(null);
        }
        public IHttpActionResult PostBusinessEmail(BusinessEmail businessEmail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CreateBusinessEmail(businessEmail);

            return(CreatedAtRoute("DefaultApi", new { id = businessEmail.BusinessEmailID }, businessEmail));
        }
        public BusinessEmailDTO Get(int businessEmailsID)
        {
            BusinessEmailDTO oBusinessEmailsDTO = null;

            if (businessEmailsID > 0)
            {
                BusinessEmail oBusinessEmails = oBusinessEmailsRepos.GetBusinessEmail(businessEmailsID);
            }

            return(oBusinessEmailsDTO);
        }
        public IHttpActionResult GetBusinessEmail(int id)
        {
            BusinessEmail businessEmail = db.GetBusinessEmail(id);

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

            return(Ok(businessEmail));
        }
        public BusinessEmailDTO Get(int id)
        {
            BusinessEmailDTO oBusinessEmailsDTO = null;

            if (id > 0)
            {
                BusinessEmail oBusinessEmails = businessEmailsRepos.GetBusinessEmail(id);
            }

            return(oBusinessEmailsDTO);
        }
Beispiel #10
0
 public void Copy(PayPalStandardPaymentSettings settings, bool fromSettings)
 {
     if (fromSettings)
     {
         MiniMapper.Map(settings, this);
     }
     else
     {
         MiniMapper.Map(this, settings);
         settings.BusinessEmail = BusinessEmail.TrimSafe();
     }
 }
        public void UpdateBusinessEmail(int id, BusinessEmail businessEmail)
        {
            db.Entry(businessEmail).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }
        }
Beispiel #12
0
        public IHttpActionResult DeleteBusinessEmail(int id)
        {
            BusinessEmail businessEmail = db.BusinessEmails.Find(id);

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

            db.BusinessEmails.Remove(businessEmail);
            db.SaveChanges();

            return(Ok(businessEmail));
        }
        public BusinessEmail DeleteBusinessEmail(int id)
        {
            BusinessEmail businessEmail = db.BusinessEmails.Find(id);

            if (businessEmail == null)
            {
                return(null);
            }

            db.BusinessEmails.Remove(businessEmail);
            db.SaveChanges();

            return(businessEmail);
        }
Beispiel #14
0
        /// <summary>
        /// Converts this instance of <see cref="BusinessEmail"/> to an instance of <see cref="BusinessEmailDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="BusinessEmail"/> to convert.</param>
        public static BusinessEmailDTO ToDTO(this BusinessEmail entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new BusinessEmailDTO();

            dto.BusinessEmailID = entity.BusinessEmailID;
            dto.BusinessID      = entity.BusinessID;
            dto.EmailID         = entity.EmailID;
            dto.IsPrimary       = entity.IsPrimary;

            entity.OnDTO(dto);

            return(dto);
        }
Beispiel #15
0
        /// <summary>
        /// Converts this instance of <see cref="BusinessEmailDTO"/> to an instance of <see cref="BusinessEmail"/>.
        /// </summary>
        /// <param name="dto"><see cref="BusinessEmailDTO"/> to convert.</param>
        public static BusinessEmail ToEntity(this BusinessEmailDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new BusinessEmail();

            entity.BusinessEmailID = dto.BusinessEmailID;
            entity.BusinessID      = dto.BusinessID;
            entity.EmailID         = dto.EmailID;
            entity.IsPrimary       = dto.IsPrimary;

            dto.OnEntity(entity);

            return(entity);
        }
 //create new business
 public void CreateBusinessApplication()
 {
     //call home page to enter inside setting window
     Thread.Sleep(500);
     BusinessCreate.ClickOn();
     softAssert.VerifyElementIsPresent(BusinessName);
     //    BusinessName.EnterClearText("1", "name test");
     BusinessSavebutton.ClickOn();
     softAssert.VerifyElementIsPresent(BusinessEmail);
     BusinessName.EnterClearText(Constant.businessName);
     BusinessPractinerNum.EnterClearText(Constant.businessNum);
     BusinessAddress.EnterClearText(Constant.businessAddress);
     BusinessCity.EnterClearText(Constant.businessCity);
     BusinessPhone.EnterClearText(Constant.businessNum);
     BusinessEmail.EnterClearText(Constant.businessEmail);
     BusinessSavebutton.ClickOn();
     softAssert.VerifySuccessMsg();
 }
Beispiel #17
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is Location other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Address == null && other.Address == null) || (Address?.Equals(other.Address) == true)) &&
                   ((Timezone == null && other.Timezone == null) || (Timezone?.Equals(other.Timezone) == true)) &&
                   ((Capabilities == null && other.Capabilities == null) || (Capabilities?.Equals(other.Capabilities) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((MerchantId == null && other.MerchantId == null) || (MerchantId?.Equals(other.MerchantId) == true)) &&
                   ((Country == null && other.Country == null) || (Country?.Equals(other.Country) == true)) &&
                   ((LanguageCode == null && other.LanguageCode == null) || (LanguageCode?.Equals(other.LanguageCode) == true)) &&
                   ((Currency == null && other.Currency == null) || (Currency?.Equals(other.Currency) == true)) &&
                   ((PhoneNumber == null && other.PhoneNumber == null) || (PhoneNumber?.Equals(other.PhoneNumber) == true)) &&
                   ((BusinessName == null && other.BusinessName == null) || (BusinessName?.Equals(other.BusinessName) == true)) &&
                   ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) &&
                   ((WebsiteUrl == null && other.WebsiteUrl == null) || (WebsiteUrl?.Equals(other.WebsiteUrl) == true)) &&
                   ((BusinessHours == null && other.BusinessHours == null) || (BusinessHours?.Equals(other.BusinessHours) == true)) &&
                   ((BusinessEmail == null && other.BusinessEmail == null) || (BusinessEmail?.Equals(other.BusinessEmail) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((TwitterUsername == null && other.TwitterUsername == null) || (TwitterUsername?.Equals(other.TwitterUsername) == true)) &&
                   ((InstagramUsername == null && other.InstagramUsername == null) || (InstagramUsername?.Equals(other.InstagramUsername) == true)) &&
                   ((FacebookUrl == null && other.FacebookUrl == null) || (FacebookUrl?.Equals(other.FacebookUrl) == true)) &&
                   ((Coordinates == null && other.Coordinates == null) || (Coordinates?.Equals(other.Coordinates) == true)) &&
                   ((LogoUrl == null && other.LogoUrl == null) || (LogoUrl?.Equals(other.LogoUrl) == true)) &&
                   ((PosBackgroundUrl == null && other.PosBackgroundUrl == null) || (PosBackgroundUrl?.Equals(other.PosBackgroundUrl) == true)) &&
                   ((Mcc == null && other.Mcc == null) || (Mcc?.Equals(other.Mcc) == true)) &&
                   ((FullFormatLogoUrl == null && other.FullFormatLogoUrl == null) || (FullFormatLogoUrl?.Equals(other.FullFormatLogoUrl) == true)));
        }
 public BusinessEmail CreateBusinessEmail(BusinessEmail businessEmail)
 {
     db.BusinessEmails.Add(businessEmail);
     db.SaveChanges();
     return(businessEmail);
 }
        public BusinessEmail GetBusinessEmail(int id)
        {
            BusinessEmail businessEmail = db.BusinessEmails.Find(id);

            return(businessEmail);
        }
Beispiel #20
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="BusinessEmail"/> converted from <see cref="BusinessEmailDTO"/>.</param>
 static partial void OnEntity(this BusinessEmailDTO dto, BusinessEmail entity)
 {
 }
Beispiel #21
0
        public override int GetHashCode()
        {
            int hashCode = -255518735;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (Address != null)
            {
                hashCode += Address.GetHashCode();
            }

            if (Timezone != null)
            {
                hashCode += Timezone.GetHashCode();
            }

            if (Capabilities != null)
            {
                hashCode += Capabilities.GetHashCode();
            }

            if (Status != null)
            {
                hashCode += Status.GetHashCode();
            }

            if (CreatedAt != null)
            {
                hashCode += CreatedAt.GetHashCode();
            }

            if (MerchantId != null)
            {
                hashCode += MerchantId.GetHashCode();
            }

            if (Country != null)
            {
                hashCode += Country.GetHashCode();
            }

            if (LanguageCode != null)
            {
                hashCode += LanguageCode.GetHashCode();
            }

            if (Currency != null)
            {
                hashCode += Currency.GetHashCode();
            }

            if (PhoneNumber != null)
            {
                hashCode += PhoneNumber.GetHashCode();
            }

            if (BusinessName != null)
            {
                hashCode += BusinessName.GetHashCode();
            }

            if (Type != null)
            {
                hashCode += Type.GetHashCode();
            }

            if (WebsiteUrl != null)
            {
                hashCode += WebsiteUrl.GetHashCode();
            }

            if (BusinessHours != null)
            {
                hashCode += BusinessHours.GetHashCode();
            }

            if (BusinessEmail != null)
            {
                hashCode += BusinessEmail.GetHashCode();
            }

            if (Description != null)
            {
                hashCode += Description.GetHashCode();
            }

            if (TwitterUsername != null)
            {
                hashCode += TwitterUsername.GetHashCode();
            }

            if (InstagramUsername != null)
            {
                hashCode += InstagramUsername.GetHashCode();
            }

            if (FacebookUrl != null)
            {
                hashCode += FacebookUrl.GetHashCode();
            }

            if (Coordinates != null)
            {
                hashCode += Coordinates.GetHashCode();
            }

            if (LogoUrl != null)
            {
                hashCode += LogoUrl.GetHashCode();
            }

            if (PosBackgroundUrl != null)
            {
                hashCode += PosBackgroundUrl.GetHashCode();
            }

            if (Mcc != null)
            {
                hashCode += Mcc.GetHashCode();
            }

            if (FullFormatLogoUrl != null)
            {
                hashCode += FullFormatLogoUrl.GetHashCode();
            }

            return(hashCode);
        }
Beispiel #22
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="BusinessEmailDTO"/> converted from <see cref="BusinessEmail"/>.</param>
 static partial void OnDTO(this BusinessEmail entity, BusinessEmailDTO dto);