Exemplo n.º 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;
		}
Exemplo n.º 2
0
		/*-----------------------------------------------------*/

		protected override string Get_SMTPHost(cAppl aAppl) {
			XmlNode aEMailParamNode;
			aEMailParamNode = Get_MailParamNode(aAppl);
			if (aEMailParamNode != null) {
				return cXMLDoc.AttributeToString(aEMailParamNode, "SMTPHost", "");
			}
			return "";
		}
Exemplo n.º 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;
		}
Exemplo n.º 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;
		}
Exemplo n.º 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;
		}
Exemplo n.º 6
0
/*-----------------------------------------------------*/

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

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

        public cDataObjectFactory(cAppl aAppl, cXMLDoc aDataDefinitionDoc)
        {
            mAppl = aAppl;
            mDataDefinitionDoc = aDataDefinitionDoc;
//		mDataProviderTable = new Hashtable();
        }
Exemplo n.º 7
0
/*-----------------------------------------------------*/

        public cUser(cAppl aAppl)
        {
            mAppl = aAppl;
        }
Exemplo n.º 8
0
/*-----------------------------------------------------*/

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

		public bool SendEmail(cAppl aAppl) {
			return SendEmail(aAppl, true);
		}
Exemplo n.º 10
0
		/*-----------------------------------------------------*/

		protected virtual string Get_SMTPHost(cAppl aAppl) {
			return "";
		}
Exemplo n.º 11
0
		/*-----------------------------------------------------*/

		protected virtual string Get_ToAddress(cAppl aAppl) {
			return "";
		}
Exemplo n.º 12
0
		/*====================================================*/

		protected virtual XmlNode Get_MailParamNode(cAppl aAppl) {
			return null;
		}
Exemplo n.º 13
0
/*-----------------------------------------------------*/

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