//Function created by pramod for save and update private void functionToSaveUpdate(bool isEdit) { //string[] sSelectedList=null; clsEmail objEntEmail; List <clsEmail> lstSelectedUser = new List <clsEmail>(); for (int iloop = 0; iloop < lstBoxSelectedUser.Items.Count; iloop++) { objEntEmail = new clsEmail(); objEntEmail.iD = int.Parse(lstBoxSelectedUser.Items[iloop].Value); lstSelectedUser.Add(objEntEmail); } if (objEmail.saveEmailGroup(txtEmailGroupName.Text, lstSelectedUser, isEdit, ((UserDetails)Session[clsConstant.TOKEN]).UserID)) { lblMessage.ForeColor = System.Drawing.Color.Blue; lblMessage.Text = "Information has been saved successfully"; lstBoxSelectedUser.Items.Clear(); lstBoxUserName.Items.Clear(); drpAgency.SelectedIndex = -1; txtEmailGroupName.Text = ""; Session.Remove("isUpdate"); } else { lblMessage.ForeColor = System.Drawing.Color.Red; lblMessage.Text = "Sorry Unable to save properly"; } }
public void EnviarNotificacion() { try { var ServidorSMTP = System.Configuration.ConfigurationManager.AppSettings["ServidorSMTP"].ToString(); var Puerto = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Puerto"].ToString()); var BuzonCorreo = System.Configuration.ConfigurationManager.AppSettings["BuzonCorreo"].ToString(); var PwdBuzon = System.Configuration.ConfigurationManager.AppSettings["PwdBuzon"].ToString(); ObjMail = new clsEmail(ServidorSMTP, Puerto, BuzonCorreo, PwdBuzon); ObjMail.From = BuzonCorreo; ObjMail.To = BuzonCorreo; ObjMail.Subject = "Notificación Contactenos Fundación Oscarez"; string strBody = "<p>Sr(a) Usuario </p>"; strBody = strBody + "<p> Se acaba de generar una notificación electronica desde el contactenos de la Fundación Oscarez con la siguiente descripción: <p>"; strBody = strBody + "<p>" + Asunto + "</p>"; strBody = strBody + "<p>" + Mensaje + "</p>"; strBody = strBody + "<p> Para obtener mas detalle del mensaje ingrese a la opción Contactenos/Index de la pagina de la Fundación Oscarez</p> <br/>"; strBody = strBody + "<p> Saludos</p>"; ObjMail.HTMLBody = strBody; ObjMail.EnviarMail(); ObjMail = null; } catch (Exception ex) { RutaLOG = System.Configuration.ConfigurationManager.AppSettings["RutaLOG"].ToString(); System.IO.File.AppendAllText(RutaLOG + "LogError" + DateTime.Today.ToString("ddMMyyyy") + ".txt", ex.Message); } }
public clsEmail DataLoader(IDataReader reader) { clsEmail clsEmailList = new clsEmail(); clsEmailList.iD = int.Parse(reader.GetValue(0).ToString()); return(clsEmailList); }
public static void sendEmail(CommonAudit.EMAIL_KEYS emailFormat, float idReport, string planta) { DataSet ds; Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@IdReport", idReport); parameters.Add("@Planta", planta); parameters.Add("@EmailKey", emailFormat.ToString()); try { DataAccess dsAuditoria = new DataAccess(); ds = dsAuditoria.executeStoreProcedureDataSet("dbo.spr_GET_EmailInformation", parameters); } catch (Exception ex) { throw ex; } string To = FormatEmails(ds.Tables[1]); string fromApp = System.Configuration.ConfigurationManager.AppSettings.Get("emailApp"); clsEmail objEmail = new clsEmail(emailFormat.ToString(), fromApp, To); //20170322 Ricardo Ramos : comentado debido a que en la importación a WMP se indicó que no existe una sobrecarga para este metodo con el parametro elegido. //objEmail.setMessage(ds.Tables[0]); try { //20170322 Ricardo Ramos : comentado debido a que en la importación a WMP se indicó que no existe una sobrecarga para este metodo con el parametro elegido. //objEmail.Send(); } catch (Exception ex) { throw ex; } }
public void InstanceOk() { string destination = ""; clsEmail anEmail = new clsEmail(destination); Assert.IsNotNull(anEmail); }
public void EmailInstanceOK() { //instance of clsEmail clsEmail AEmail = new clsEmail(); //check if not null Assert.IsNotNull(AEmail); }
public void TimeStampMax() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; OK = TestEmail.TimeStampValid("2016"); //check to see if result is ok Assert.IsTrue(OK); }
protected void btnRegisterStaffMember_Click(object sender, EventArgs e) { bool editStaffMember = Convert.ToBoolean(Session["editStaffMember"]); string firstName = txtNewStaffMemberFirstName.Text; string lastName = txtNewStaffMemberLastName.Text; Int32 userId = Convert.ToInt32(ddlUserId.SelectedItem.Value); Int32 privilegeLevelId = Convert.ToInt32(ddlPrivilegelevel.SelectedValue); Boolean suspended = chkStaffMemberSuspended.Checked; clsStaffMemberCollection AllStaffMembers = new clsStaffMemberCollection(); AllStaffMembers.ThisStaffMember.StaffMemberId = Convert.ToInt32(Session["StaffMemberId"]); AllStaffMembers.ThisStaffMember.UserId = userId; AllStaffMembers.ThisStaffMember.PrivilegeLevelId = privilegeLevelId; AllStaffMembers.ThisStaffMember.FirstName = firstName; AllStaffMembers.ThisStaffMember.LastName = lastName; AllStaffMembers.ThisStaffMember.Allowed = suspended; if (editStaffMember) { userId = Convert.ToInt32(Session["UserId"]); } var manager = Context.GetOwinContext().GetUserManager <ApplicationUserManager>(); var user = manager.FindById(userId); clsEmail AnEmail = new clsEmail(user.Email); if (editStaffMember) { if (suspended) { DateTime suspendedEndDate = DateTime.Now.AddDays(3); AnEmail.SendUserSuspensionEmail(suspendedEndDate); user.LockoutEnabled = true; user.LockoutEndDateUtc = suspendedEndDate; manager.Update(user); } if (privilegeLevelId != originalPrivilegeLevel) { AnEmail.SendStaffMemberPrivilegeChangeEmail(); } AllStaffMembers.Update(); } else { AllStaffMembers.Add(); AnEmail.SendNewStaffMemberStandardNoticeEmail(); } grdAllStaffMembers.EditIndex = -1; pnlNewStaffMember.Visible = false; LoadStaffMemberData(); }
public void EmailSubjectMinLessOne() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.EmailSubjectValid("Aa"); Assert.IsFalse(OK); }
public void EmailSubjectMax() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; OK = TestEmail.EmailSubjectValid("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); //check to see if result is ok Assert.IsTrue(OK); }
public void TimeStampMinLessOne() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.TimeStampValid("1985"); Assert.IsFalse(OK); }
public void EmailAddressWithoutAt() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.Valid("mulgrewaaron1gmail.com"); //check to see if result is ok Assert.IsFalse(OK); }
public void EmailAddressMid() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.Valid("*****@*****.**"); //check to see if result is ok Assert.IsTrue(OK); }
public void TimeStampOK() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //put in some test data DateTime TestData = new DateTime(25 / 07 / 2012); //assign the data to the property TestEmail.EmailTimeStamp = TestData; //check to see the data is equal Assert.AreEqual(TestEmail.EmailTimeStamp, TestData); }
public void EmailAddressMinLessOne() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.Valid(""); //check to see if result is ok Assert.IsFalse(OK); }
public void EmailAddressExtreme() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.Valid("*****@*****.**"); //check to see if result is ok Assert.IsFalse(OK); }
public void EmailAddressNoOK() { //instance of clsEmail clsEmail AEmail = new clsEmail(); //test data to the property Int32 SomeEmailAddressNo = 1; //assign the data to the property AEmail.EmailAddressNo = SomeEmailAddressNo; //test the data to see the two are equal Assert.AreEqual(AEmail.EmailAddressNo, SomeEmailAddressNo); }
public void EmailTimeStampOK() { //create an instance of the class clsEmail AnEmail = new clsEmail(); ///create some test data (the current date) DateTime testData = DateTime.Now.Date; //test data to the property AnEmail.EmailTimeStamp = testData; //check to see if ok Assert.AreEqual(AnEmail.EmailTimeStamp, testData); }
public void EmailSubjectOK() { //create an instance of the class clsEmail AnEmail = new clsEmail(); ///create some test data (the current date) String testData = "blahblahblah"; //test data to the property AnEmail.EmailSubject = testData; //check to see if ok Assert.AreEqual(AnEmail.EmailSubject, testData); }
public void EmailAddressOK() { //instance of clsEmail clsEmail AEmail = new clsEmail(); //test data to the property string SomeEmailAddress = "*****@*****.**"; //assign the data to the property AEmail.EmailAddress = SomeEmailAddress; //test the data to see the two are equal Assert.AreEqual(AEmail.EmailAddress, SomeEmailAddress); }
public void EmailContentOK() { //create an instance of the class clsEmail AnEmail = new clsEmail(); ///create some test data String testData = "skslskslkslk"; //test data to the property AnEmail.EmailContent = testData; //check to see if ok Assert.AreEqual(AnEmail.EmailContent, testData); }
public void TimeStampMaxInvalidData() { //instance of the clsEmail clsEmail TestEmail = new clsEmail(); //test data to store result of validation Boolean OK; //test data to the property OK = TestEmail.TimeStampValid("101010101"); //check to see if result is ok Assert.IsFalse(OK); }
public static void setEmailError(clsParametros objParametros, string sAsunto) { try { string bEnvioError = clsValidaciones.GetKeyOrAdd("bEnvioErrorSabre", "False"); if (bEnvioError.ToUpper().Equals("TRUE")) { StringBuilder consulta = new StringBuilder(); try { consulta.AppendLine("---- Code: "); consulta.AppendLine(objParametros.Code); consulta.AppendLine("---- Mensaje:"); consulta.AppendLine(objParametros.Message); consulta.AppendLine("---- Metodo:"); consulta.AppendLine(objParametros.Complemento); consulta.AppendLine("---- Complemento:"); consulta.AppendLine(objParametros.Metodo); consulta.AppendLine("---- Info:"); consulta.AppendLine(objParametros.Info); sAsunto = "ERROR SABRE - " + sAsunto; } catch { } clsEmail cEmail = new clsEmail(); string sCC = clsValidaciones.GetKeyOrAdd("strEmailCC", "*****@*****.**"); string sTo = clsValidaciones.GetKeyOrAdd("strEmailTo", "*****@*****.**"); string sCCO = clsValidaciones.GetKeyOrAdd("strEmailCCO", "*****@*****.**"); string sFrom = clsValidaciones.GetKeyOrAdd("strEmailEnvio", "*****@*****.**"); cEmail.EnviarMensaje(consulta.ToString(), sAsunto, OperacionEmail.Email, sTo, sCC, sCCO, FormatMail.Text, sFrom); } } catch (Exception Ex) { clsParametros cParametros = new clsParametros(); cParametros.Id = 0; cParametros.Message = Ex.Message.ToString(); cParametros.Source = Ex.Source.ToString(); cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Moderada; cParametros.StackTrace = Ex.StackTrace.ToString(); cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; ExceptionHandled.Publicar(cParametros); } }
public void ViewArchiveEmail(int EmailAddressNo, int ArchiveNo) { clsEmail OneEmail = new clsEmail(); clsEmailCollection AllEmails = new clsEmailCollection(); EmailAddress = AllEmails.GetEmailAddress(EmailAddressNo); bool IsArchive = true; AllEmails.GetOneEmail(ArchiveNo, IsArchive, out EmailSubject, out EmailContent); txtBxSubject.Text = EmailSubject; txtBxContent.Text = EmailContent; txtBxFrom.Text = EmailAddress; }
public void EmailValidMethodOK() { //instance of clsEmail clsEmail AEmail = new clsEmail(); //test data to store result of validation Boolean OK = false; //assign the data to the property string SomeEmail = "*****@*****.**"; //invoke the method OK = AEmail.Valid(SomeEmail); //check to see if result is ok Assert.IsTrue(OK); }
//this will be the function that shows the new email and it accepts the emailno selected in //the datagridview public void NewEmail(int EmailAddressNo, int EmailNo) { //txtBxFrom.Text = Convert.ToString(EmailAddressNo); clsEmail OneEmail = new clsEmail(); clsEmailCollection AllEmails = new clsEmailCollection(); EmailAddress = AllEmails.GetEmailAddress(EmailAddressNo); bool IsArchive = false; AllEmails.GetOneEmail(EmailNo, IsArchive, out EmailSubject, out EmailContent); txtBxSubject.Text = EmailSubject; txtBxContent.Text = EmailContent; txtBxFrom.Text = EmailAddress; }
//correo para solicitar confirmación de cuenta public static void SendMailByDictionary(Dictionary <string, string> dicEmailInfo, Dictionary <string, Stream> dicFiles, string emailTo, String Key, string mail, string token) { clsEmail email = new clsEmail(Key); try { email.setMessage(dicEmailInfo); email.setFiles(dicFiles); email.ToAdress = emailTo; email.Send(mail, token); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static void SendMailByDictionary(Dictionary <string, string> dicEmailInfo, Dictionary <string, Stream> dicFiles, string emailTo, String Key, string razon, string comentarios, string fumigacion) { clsEmail email = new clsEmail(Key); try { email.setMessage(dicEmailInfo); email.setFiles(dicFiles); email.ToAdress = emailTo; email.Send(razon, comentarios, fumigacion); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void CountEmailAddressMatchesList() { //create instance of the class clsEmailAddressCollection Emails = new clsEmailAddressCollection(); //create some test data List <clsEmail> TestList = new List <clsEmail>(); //add an item to the list clsEmail TestItem = new clsEmail(); //set the properties TestItem.EmailAddressNo = 1; TestItem.EmailAddress = "*****@*****.**"; //add the item to the test list TestList.Add(TestItem); //assign the data Emails.AllEmailAddresses = TestList; //test to see that the two are the same Assert.AreEqual(Emails.CountEmailAddresses, TestList.Count); }
protected void grdAllUsers_RowUpdating(object sender, GridViewUpdateEventArgs e) { Int32 userId = Convert.ToInt32(((Label)grdAllUsers.Rows[e.RowIndex].FindControl("lblUserId")).Text); Boolean suspended = ((CheckBox)grdAllUsers.Rows[e.RowIndex].FindControl("chkSuspended")).Checked; if (suspended != false) { var manager = Context.GetOwinContext().GetUserManager <ApplicationUserManager>(); var user = manager.FindById(userId); user.LockoutEnabled = suspended; user.LockoutEndDateUtc = DateTime.Now.AddDays(3); clsEmail AnEmail = new clsEmail(user.Email); DateTime lockoutEnd = Convert.ToDateTime(user.LockoutEndDateUtc); manager.Update(user); AnEmail.SendUserSuspensionEmail(lockoutEnd); } LoadUserData(); }
//correo para solicitar confirmación de cuenta public static void SendMailByDictionary(Dictionary<string, string> dicEmailInfo, Dictionary<string, Stream> dicFiles, string emailTo, String Key, string mail, string token) { clsEmail email = new clsEmail(Key); try { email.setMessage(dicEmailInfo); email.setFiles(dicFiles); email.ToAdress = emailTo; email.Send(mail, token); } catch (Exception ex) { throw new Exception(ex.Message); } }