Beispiel #1
0
		/*-----------------------------------------------------*/

		protected override XmlNode Get_MailParamNode(cAppl aAppl) {
			XmlNode aEMailParamNode;
			aEMailParamNode = cXMLDoc.FindNodeWithChildNode(((cWebAppl) aAppl).Get_ApplNode(),
											"EMailParams/EMailParam",
											"ReleaseBuild", "BuildKey", aAppl.BuildKey);
			return aEMailParamNode;
		}
Beispiel #2
0
		/*-----------------------------------------------------*/

		protected override string Get_SMTPHost(cAppl aAppl) {
			XmlNode aEMailParamNode;
			aEMailParamNode = Get_MailParamNode(aAppl);
			if (aEMailParamNode != null) {
				return cXMLDoc.AttributeToString(aEMailParamNode, "SMTPHost", "");
			}
			return "";
		}
Beispiel #3
0
		/*-----------------------------------------------------*/

		protected string GetCloseTag(cAppl aAppl) {
			String strTag = ">";
			XmlNode aEmailMergeNode;
			aEmailMergeNode = cXMLDoc.FindNode(((cWebAppl) aAppl).Get_ApplNode(),
											"EMailParams/EmailMerge", "Key", "Tags");
			if (aEmailMergeNode != null) {
				strTag = cXMLDoc.AttributeToString(aEmailMergeNode, "CloseTag", ">");
			}
			if (mIsHtml) {
				strTag = "/" + strTag;
			}
			return strTag;
		}
Beispiel #4
0
		/*-----------------------------------------------------*/

		public virtual void SetMailMessageParams(cAppl aAppl) {
			//XmlNode		aEMailParamNode;
			//String		aEMailParamToAddress;

			mMailMessage = new MailMessage();
			mMailMessage.From = mFrom;
			if (mFromName != "") {
				mMailMessage.Headers.Add("From", string.Format("{0} <{1}>", mFromName, mFrom));
			}

			//email sent from development, testin or demo servers
			//aEMailParamToAddress = Get_ToAddress(aAppl);

			if (aAppl.EmailSwitchEnabled == true) {
				if (mIsHtml) {
					mMailMessage.Body = "To: " + mTo + "<br>" + "Cc: " + mCc + "<br>" +
						"Bcc: " + mBcc + "<br>" + "<br>" + mBodyText;
					mMailMessage.BodyFormat = MailFormat.Html;
				} else {
					mMailMessage.Body = "To: " + mTo + "\n" + "Cc: " + mCc + "\n" +
						"Bcc: " + mBcc + "\n" + "\n" + mBodyText;
					mMailMessage.BodyFormat = MailFormat.Text;
				}

				//			if (aEMailParamToAddress != "") {
				//				mMailMessage.To = aEMailParamToAddress;
				//			}
			} else {
				mMailMessage.To = mTo;
				mMailMessage.Cc = mCc;
				mMailMessage.Bcc = mBcc;
				mMailMessage.Body = mBodyText;
				if (mIsHtml)
					mMailMessage.BodyFormat = MailFormat.Html;
				else
					mMailMessage.BodyFormat = MailFormat.Text;
			}
			if (aAppl.BuildKey != "Release") {
				if (mIsHtml) {
					mMailMessage.Body = "Server: " + Server.MachineName + "<br>" + "Build: " + aAppl.BuildKey + "<br>" + mMailMessage.Body;
				} else {
					mMailMessage.Body = "Server: " + Server.MachineName + "\n" + "Build: " + aAppl.BuildKey + "\n" + mMailMessage.Body;
				}
			}

			mMailMessage.Subject = mSubject;
		}
Beispiel #5
0
		/*----------------------------------------------------*/

		public bool SendEmail(cAppl aAppl, bool aSetParams) {
			String aSMTPHost;
			bool aReturnValue = false;

			aSMTPHost = Get_SMTPHost(aAppl);
			if (aSMTPHost != "")
				SmtpMail.SmtpServer = aSMTPHost;

			if (EmailArgs != null) {
				foreach (cDataObject aDataObject in EmailArgs.BaseDataObjList) {
					if (aSetParams) {
						SetEmailParams(aDataObject);
						//SetMailMessageParams(aAppl);
					}
					SetMailMessageParams(aAppl);

					if (mMailMessage.To != "") {
						SmtpMail.Send(mMailMessage);
						aReturnValue = true;
					}
					if (mIsLog)
						InsertEmailLog();
				}
			} else {
				if (aSetParams) {
					SetEmailParams();
					//SetMailMessageParams(aAppl);	
				}
				SetMailMessageParams(aAppl);

				if (mMailMessage.To != "") {
					SmtpMail.Send(mMailMessage);
					aReturnValue = true;
				}
				if (mIsLog)
					InsertEmailLog();
			}
			return aReturnValue;
		}
/*-----------------------------------------------------*/

//	protected Hashtable DataProviderTable
//	{
//		get {return mDataProviderTable;}
//		set {mDataProviderTable = value;}
//	}

/*-----------------------------------------------------*/

        public cDataObjectFactory(cAppl aAppl, cXMLDoc aDataDefinitionDoc)
        {
            mAppl = aAppl;
            mDataDefinitionDoc = aDataDefinitionDoc;
//		mDataProviderTable = new Hashtable();
        }
Beispiel #7
0
/*-----------------------------------------------------*/

        public cUser(cAppl aAppl)
        {
            mAppl = aAppl;
        }
Beispiel #8
0
/*-----------------------------------------------------*/

        public cDataProviderXML(cAppl aAppl, string aDataFile) :
            base(aAppl)
        {
            mDataDoc = new cXMLDoc(Appl.Build_RootFileSystemPath(aDataFile));
        }
Beispiel #9
0
		/*----------------------------------------------------*/

		public bool SendEmail(cAppl aAppl) {
			return SendEmail(aAppl, true);
		}
Beispiel #10
0
		/*-----------------------------------------------------*/

		protected virtual string Get_SMTPHost(cAppl aAppl) {
			return "";
		}
Beispiel #11
0
		/*-----------------------------------------------------*/

		protected virtual string Get_ToAddress(cAppl aAppl) {
			return "";
		}
Beispiel #12
0
		/*====================================================*/

		protected virtual XmlNode Get_MailParamNode(cAppl aAppl) {
			return null;
		}
Beispiel #13
0
/*-----------------------------------------------------*/

        public cDataProvider(cAppl aAppl)
        {
            mAppl = aAppl;
        }