public static bool UpdateCertificateById(GiftCertificate certificate) { SQLDataAccess.ExecuteNonQuery("[Catalog].[sp_UpdateCertificateById]", CommandType.StoredProcedure, new SqlParameter("@CertificateId", certificate.CertificateId), new SqlParameter("@CertificateCode", certificate.CertificateCode), new SqlParameter("@OrderNumber", certificate.OrderNumber), new SqlParameter("@FromName", certificate.FromName), new SqlParameter("@ToName", certificate.ToName), new SqlParameter("@Used", certificate.Used), new SqlParameter("@Paid", certificate.Paid), new SqlParameter("@Enable", certificate.Enable), new SqlParameter("@Type", certificate.Type), new SqlParameter("@Sum", certificate.Sum), new SqlParameter("@Message", certificate.CertificateMessage), new SqlParameter("@Email", String.IsNullOrEmpty(certificate.Email) ? (object)DBNull.Value : certificate.Email), new SqlParameter("@Country", String.IsNullOrEmpty(certificate.Country) ? (object)DBNull.Value : certificate.Country), new SqlParameter("@Zone", String.IsNullOrEmpty(certificate.Zone) ? (object)DBNull.Value : certificate.Zone), new SqlParameter("@City", String.IsNullOrEmpty(certificate.City) ? (object)DBNull.Value : certificate.City), new SqlParameter("@Zip", String.IsNullOrEmpty(certificate.Zip) ? (object)DBNull.Value : certificate.Zip), new SqlParameter("@Address", String.IsNullOrEmpty(certificate.Address) ? (object)DBNull.Value : certificate.Address), new SqlParameter("@CurrencyCode", certificate.CurrencyCode), new SqlParameter("@CurrencyValue", certificate.CurrencyValue), new SqlParameter("@FromEmail", certificate.FromEmail) ); return(true); }
public static void SendCertificateMails(GiftCertificate certificate) { string htmlMessage = SendMail.BuildMail(new ClsMailParamOnSendCertificate { CertificateCode = certificate.CertificateCode, FromName = certificate.FromName, ToName = certificate.ToName, Message = certificate.CertificateMessage, Sum = CatalogService.GetStringPrice(certificate.Sum) }); SendMail.SendMailNow(certificate.Email, Resources.Resource.Admin_GiftCertificate_Certificate, htmlMessage, true); SendMail.SendMailNow(certificate.FromEmail, Resources.Resource.Admin_GiftCertificate_CertificateSend + " " + certificate.Email, htmlMessage, true); }