public ActionResult RegisterUserProposalSumit(string Email) { SentMail email = new SentMail(); string res = GenaratorPass(); UserModel user = new UserModel(); user.Email = Email; user.Password = res; string mensaje = "<p>Usted fue invitado a votar a la propuesta Salvemos a Lucho</p>" + "<p>Su Usuario es :" + Email + "</p>" + "<p>Su número de token para participar en la votación es : " + res + "</p>"; using (UserDataAccess userDataAccess = new UserDataAccess()) { List <UserModel> list = userDataAccess.SearchUser(user.Email); bool isValidUser = false; if (list == null || list.Count == 0) { isValidUser = userDataAccess.InserUser(user); } else { userDataAccess.UpdateUser(user, 3); } } email.SentEmail(mensaje, Email, "Solicitud de Votación", "Votacion de " + ((ProposalModel)Session["Proposal"]).ProposalName); ViewBag.Proposal = Session["Proposal"]; return(View("SendUpload")); }
public ActionResult RegisterUserProposalSumit(string Email) { SentMail email = new SentMail(); string res = GenaratorPass(); UserModel user = new UserModel() { Email = Email, Password = res, }; string mensaje = "<p>Usted fue invitado a votar a la propuesta Salvemos a Lucho</p>" + "<p>Su Usuario es :" + Email + "</p>" + "<p>Su número de token para participar en la votación es : " + res + "</p>"; bool valid; using (UserDataAccess userDataAccess = new UserDataAccess()) { valid = userDataAccess.UpdateUser(user, 3); } return(View()); }
public ActionResult Create(SentMail model) { ModelState.Remove("DateTime"); ModelState.Remove("Username"); if (ModelState.IsValid) { SentMail sm = new SentMail() { Subject = model.Subject, Text = model.Text, ToEmail = model.ToEmail, Username = CurrentSession.User.Username, DateTime = DateTime.Now }; BusinessLayerResult <SentMail> res = _sentMailManager.Insert(sm); if (res.Errors.Count > 0) { // başarısız res.Errors.ForEach(x => ModelState.AddModelError("", x.Message)); } else { // başarılı return(RedirectToAction("Index", "Contact")); } } return(View(model)); }
protected void btnSave_Click(object sender, EventArgs e) { bool Result = false; int ID = Convert.ToInt32(Session["ID"]); string Path = ""; string Data = labDate.Text.ToString() + txtYear.Text.ToString(); if (fuSignatureStudent.HasFile) { string Private = fuSignatureStudent.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + fuSignatureStudent.FileName.ToString(); fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName); SignatureStudents newSig = new SignatureStudents(); string Pasword = txtPassSign.Text.ToString(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { int row = Convert.ToInt32(Request.QueryString["id"]); string Reason = ""; string year = ""; string semester = ""; if (txtStatus.Text != string.Empty) { Reason = txtStatus.Text.ToString(); } if (txtYear.Text != string.Empty) { year = txtYear.Text.ToString(); } if (ddlSemester.SelectedIndex != 0 && ddlSemester.SelectedIndex != -1) { semester = ddlSemester.Text.ToString(); } DelaySemesterClass obj = new DelaySemesterClass(); string Datenow = labDate.Text.ToString(); NowTimeUniversity timee = new NowTimeUniversity(); DataRow T = timee.drSearchYearANdSemester(); string nowsemester = T["NowSemester"].ToString(); string nowYear = T["NowYear"].ToString(); if (obj.UpdateDelaySemester(row, ID, nowYear, nowsemester, year, semester, Reason, Datenow) == 1) { txtStatus.Text = ""; ddlSemester.SelectedIndex = 0; txtYear.Text = ""; SentMail s = new SentMail(); s.sendemailReg(); } errorLabel.Visible = false; } else { errorLabel.Text = " التوقيع المدخل خاطئ أو كلمة المرور"; errorLabel.Visible = true; } }
public bool RegisterUser(UserModel user, out bool UserExist) { bool valid = false; UserExist = false; List <UserModel> userConsult = null; using (UserDataAccess userDataAccess = new UserDataAccess()) { userConsult = userDataAccess.SearchUser(user.Email); if (userConsult != null && userConsult.Count > 0) { UserExist = true; } else { valid = userDataAccess.InserUser(user); if (valid) { SentMail mail = new SentMail(); if (user.Profile == 1) { EmailMasagge emailMesagge = new EmailMasagge(); string htmlTemplade = "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td style='padding: 10px 0 30px 0;'><table align='center' border='0' cellpadding='0' cellspacing='0' width='600' style='border: 1px solid #cccccc; border-collapse: collapse;'>" + "<tr><td align='center' bgcolor='#70bbd9' style='padding: 40px 0 30px 0; color: #153643; font-size: 28px; font-weight: bold; font-family: Arial, sans-serif;'>" + "</td></tr><tr Style='font-family: Calibri'><td bgcolor='#ffffff' style='padding: 40px 30px 40px 30px; font-family: Calibri'>{0}" + "</td></tr><tr><td bgcolor='#0a4871' style='padding: 30px 30px 30px 30px;'><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>" + "<td style='color: #ffffff; font-family: Calibri; font-size: 14px;' width='75%'>Copyright 2017 | Todos los Derechos Reservados<br/>" + "<a href='http://raykel.eastus.cloudapp.azure.com/EthereumWeb/' style='color: #ffffff;'><font color='#ffffff'>Ingreso</font></a> </td><td align='right' width='25%'></td></tr></table></td></tr></table></td></tr></table>"; emailMesagge.AdressSMTP = "smtp.gmail.com"; emailMesagge.Body = string.Format(htmlTemplade, "Se acaba de registrar el correo electrónico:" + user.Email + " y su contraseña: " + user.Password); emailMesagge.CredencialPass = "******"; emailMesagge.CredencialUser = "******"; emailMesagge.Emails = new List <string> { user.Email }; emailMesagge.EnableCredencial = true; emailMesagge.EnableSSL = true; emailMesagge.PortSMTP = 587; emailMesagge.From = "Permiso de Creación de Propuesta"; emailMesagge.Subject = "Datos de acceso"; mail.Email(emailMesagge); } else { } } else { } } } return(valid); }
public ActionResult DeleteConfirmed(int id) { SentMail sentMail = db.SentMails.Find(id); db.SentMails.Remove(sentMail); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult SentEmailForgotPasswor(string email) { SentMail mail = new SentMail(); mail.SentEmail("Se solicito un cambio de contraseña, por favor dirigirse a la direccion http://localhost/EthereumWeb/Home/ChangePassword?email=" + email, email, "Solicitud de Cambio de Contraseña", "Cambio de COntraseña"); ViewBag.Envio = "Se envió el correo para la modificación de la contraseña"; return(View(ViewBag)); }
public ActionResult Edit([Bind(Include = "Id,Message,UserId")] SentMail sentMail) { if (ModelState.IsValid) { db.Entry(sentMail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sentMail)); }
public ActionResult Send(string To = "", string Subject = "", string Body = "", string CC = "", string BCC = "", bool persist = true, string Date = "", string CId = "") { var mail = new SentMail { To = To, Subject = Subject, Body = Body, CC = CC, Bcc = BCC, SMTPserver = CId }; //User As Temp for hold CommentId return(PartialView("MailSender", mail)); }
public ActionResult Create([Bind(Include = "Id,Message,UserId")] SentMail sentMail) { if (ModelState.IsValid) { db.SentMails.Add(sentMail); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sentMail)); }
private void GetSentItemsCompleted(ReceivedResponses responses) { IsLoading = false; var sentItemsResponse = responses.Get <GetImapFolderItemsResponse> ("Sent Items"); foreach (var messsage in sentItemsResponse.Messsages) { SentMail.Add(messsage); } _retrieveSentTimer.Start(); }
protected void btnResetPass_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Session["ID"].ToString()); Employee loginEmp = new Employee(); DataRow loginS = loginEmp.drSearchEmployeeEmail(ID); string email = loginS["Email"].ToString(); SentMail S = new SentMail(); S.sendemailNewSignatureEmp(email, ID); labError.Visible = true; error.Style.Add("display", "block"); }
// GET: SentMails/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SentMail sentMail = db.SentMails.Find(id); if (sentMail == null) { return(HttpNotFound()); } return(View(sentMail)); }
public ActionResult SentMailDetails(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SentMail model = _sentMailManager.Find(x => x.Id == id); if (model == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } return(View(model)); }
protected void btnSaveDean_Click(object sender, EventArgs e) { if (fuSignatureDean.HasFile && rbtAcceptDean.SelectedValue != null && txtDescriptionDean.Text != String.Empty) { bool Result = false; int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = labNumberStudent.Text.ToString() + txtCourseNum1.Text.ToString() + txtCourseNum2.Text.ToString() + txtCourseNum3.Text.ToString() + txtCourseNum4.Text.ToString() + txtDateCourse1.Text.ToString() + txtDateCourse2.Text.ToString() + txtDateCourse3.Text.ToString() + txtDateCourse4.Text.ToString() + labDateDean.Text.ToString() + rbtAcceptDean.SelectedValue.ToString(); if (fuSignatureDean.HasFile) { string Private = fuSignatureDean.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("../Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignatureDean.SaveAs(Server.MapPath("../Test") + "/" + fuSignatureDean.FileName); SignatureEmployee newSig = new SignatureEmployee(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { AbsenceExam obj = new AbsenceExam(); int id = Convert.ToInt32(Request.QueryString["id"]); string descrptionDean = txtDescriptionDean.Text.ToString(); int AcceptDean = Convert.ToInt32(rbtAcceptDean.SelectedValue.ToString()); if (obj.AcceptAbsenceExam(id, AcceptDean, descrptionDean) == 1) { DataRow dr = obj.drgetform(id); int STUid = Convert.ToInt32(dr["StudentID"].ToString()); SentMail s = new SentMail(); s.sendemailStudent(STUid); Response.Redirect("ProcessRequest2.aspx"); } errorLabel.Visible = false; } else { errorLabel.Text = "التوقيع المدخل خاطئ او كلمة المرور"; errorLabel.Visible = true; } } }
private void RequestSentItemsContent(object sender, EventArgs e) { _retrieveSentTimer.Stop(); Debug.WriteLine(string.Format("{0} - Send request to retrieve Sent Items", DateTime.Now.TimeOfDay.ToString())); IAsyncRequestDispatcher requestDispatcher = _dispatcherFactory.CreateAsyncRequestDispatcher(); requestDispatcher.Add( "Sent Items", new GetImapFolderItemsRequest { FolderName = "Sent Items", LastId = SentMail.Select(sm => sm.Id).OrderByDescending(i => i).FirstOrDefault() }); IsLoading = true; requestDispatcher.ProcessRequests(GetSentItemsCompleted, HandleRequestDispatcherException); }
public async Task <ActionResult> Create(NhanVienViewModel nhanVien, HttpPostedFileBase avatar) { if (avatar != null && avatar.ContentLength > 0) { try { string path = Path.Combine(Server.MapPath("~/Content/image/user"), Path.GetFileName(avatar.FileName)); avatar.SaveAs(path); nhanVien.avatar = avatar.FileName; } catch (Exception ex) { ViewBag.Message = "ERROR:" + ex.Message.ToString(); } } else { nhanVien.avatar = "default.png"; } try { string content = System.IO.File.ReadAllText(Server.MapPath("~/Content/client/template/themnhanvien.html")); content = content.Replace("{{TenNhanVien}}", nhanVien.tenNhanVien); content = content.Replace("{{Username}}", nhanVien.userName); content = content.Replace("{{Password}}", nhanVien.password); String subject = "Thông tin từ cửa hàng BK Computer!!!"; SentMail.Sent(subject, nhanVien.email, "*****@*****.**", "T12345678", content); await _nhanVienKhoBus.Create(nhanVien); SetAlert("Đã thêm nhân viên thành công!!!", "success"); } catch { TempData["nhanVien"] = nhanVien; SetAlert("Đã xảy ra lỗi! Bạn hãy thêm lại", "error"); } return(RedirectToAction("Index")); }
protected void btnSaveHead_Click(object sender, EventArgs e) { bool Result = false; int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = txtNumCourse1.Text.ToString() + txtNumCourse2.Text.ToString() + txtNumCourse3.Text.ToString() + txtNmberHours.Text.ToString() + txtNumHourAfter.Text.ToString() + DateTime.Today.ToString() + rbtAceptHead.SelectedValue.ToString(); if (fuSignatureHead.HasFile) { string Private = fuSignatureHead.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignatureHead.SaveAs(Server.MapPath("Test") + "/" + fuSignatureHead.FileName); SignatureEmployee newSig = new SignatureEmployee(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { PullCourseClass obj = new PullCourseClass(); int id = Convert.ToInt32(Request.QueryString["id"]); int AcceptHead = Convert.ToInt32(rbtAceptHead.SelectedValue.ToString()); string HeadDec = txtDescriptionHead.Text.ToString(); if (obj.AcceptHeadPullCourse(id, AcceptHead, HeadDec) == 1) { DataRow dr = obj.drgetform(id); int STUid = Convert.ToInt32(dr["StudentID"].ToString()); SentMail s = new SentMail(); s.sendemailDean(STUid); Response.Redirect("ProcessRequest.aspx"); } errorHead.Visible = false; } else { errorHead.Text = "التوقيع المدخل خاطئ او كلمة المرور"; errorHead.Visible = true; } }
public ActionResult Send(FormCollection collection) { var obj = new SentMail(); this.RadynTryUpdateModel(obj, collection); if (!string.IsNullOrEmpty(obj.To)) { var Template = collection["Usetemplate"]; if (Template != null) { if (Template.Contains("true")) { //var Emailtemplate = // XmlReaderComponent.XmlFile[AppCode.Constants.XmlReader.StaticPages, "RadynMailTemplate"]; //var tmp = Emailtemplate.Replace("<MessageSubject>", obj.Subject); //tmp = tmp.Replace("<MessageBody>", obj.Body); //obj.Body = tmp; } } obj.SendDate = DateTime.Now; var fileAtachments = new List <HttpPostedFileBase>(); for (int i = 0; i < 10; i++) { string index = "File" + i; var fileAttach = (HttpPostedFileBase)Session[index]; if (fileAttach == null) { break; } Session.Remove(index); fileAtachments.Add(fileAttach); } MessageComponenet.Instance.MailFacade.SendMail(obj.To, obj.Subject, obj.Body, Attachments: fileAtachments, Bcc: obj.Bcc, Cc: obj.CC, Persist: true); return(Content(Resources.Message.SentMailMessage)); } return(null); }
public IEnumerable <SentMail> SendMail(IEnumerable <Message> mailMessages) { var output = new List <SentMail>(); // Modify this to suit your business case: string mailUser = "******"; string mailUserPwd = "yourPassword"; SmtpClient client = new SmtpClient("smptp.yourMailHost.com"); client.Port = 587; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials = false; System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(mailUser, mailUserPwd); client.EnableSsl = true; client.Credentials = credentials; foreach (var msg in mailMessages) { var mail = new MailMessage(msg.User.Email.Trim(), msg.Recipient.Email.Trim()); mail.Subject = msg.Subject; mail.Body = msg.MessageBody; try { client.Send(mail); var sentMessage = new SentMail() { MailRecipientId = msg.Recipient.MailRecipientId, SentToMail = msg.Recipient.Email, SentFromMail = msg.User.Email, SentDate = DateTime.Now }; output.Add(sentMessage); } catch (Exception ex) { throw ex; // Or, more likely, do some logging or something } } return(output); }
protected void btnSaveReg_Click(object sender, EventArgs e) { bool Result = false; int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = DateTime.Today.ToString() + txtNumHours.Text.ToString() + labDate.Text.ToString() + rbtAceptHead.SelectedValue.ToString() + rbtAcceptAcadimic.SelectedValue.ToString() + rbtDeanAccept.SelectedValue.ToString() + rbtDepAcept.SelectedValue.ToString() + rbtAcceptRegistration.SelectedValue.ToString(); if (fuSignatureReg.HasFile) { string Private = fuSignatureReg.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignatureReg.SaveAs(Server.MapPath("Test") + "/" + fuSignatureReg.FileName); SignatureEmployee newSig = new SignatureEmployee(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { DropSemester obj = new DropSemester(); int id = Convert.ToInt32(Request.QueryString["id"]); int AcceptReg = Convert.ToInt32(rbtAcceptRegistration.SelectedValue.ToString()); string RegDec = txtDescriptionReg.Text.ToString(); if (obj.AcceptRegDropSemester(id, AcceptReg, RegDec) == 1) { DataRow dr = obj.drgetform(id); int STUid = Convert.ToInt32(dr["StudentID"].ToString()); SentMail s = new SentMail(); s.sendemailStudent(STUid); Response.Redirect("ProcessRequestReg.aspx"); } errorReg.Visible = false; } else { errorReg.Text = "التوقيع المدخل خاطئ او كلمة المرور"; errorReg.Visible = true; } }
protected void btnSaveAcadimic_Click(object sender, EventArgs e) { bool Result = false; int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = txtNumberCourse1.Text.ToString() + txtAlternativeNum1C1.Text.ToString() + labHoursCourse1.Text.ToString() + labHoursAlternative.Text.ToString() + labDateAcadimic.Text.ToString() + rbtAcademic.SelectedValue.ToString(); if (fuSignatureAcadimic.HasFile) { string Private = fuSignatureAcadimic.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("../Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignatureAcadimic.SaveAs(Server.MapPath("../Test") + "/" + fuSignatureAcadimic.FileName); SignatureEmployee newSig = new SignatureEmployee(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { AlternativeSub obj = new AlternativeSub(); int id = Convert.ToInt32(Request.QueryString["id"]); int AcceptAcadimic = Convert.ToInt32(rbtAcademic.SelectedValue.ToString()); if (obj.AcceptAcademicAdvisorAltiSubj(id, AcceptAcadimic) == 1) { DataRow dr = obj.drgetform(id); int STUid = Convert.ToInt32(dr["StudentID"].ToString()); SentMail s = new SentMail(); s.sendemailHead(STUid); Response.Redirect("ProcessRequestAcademic.aspx"); } errorAcadimic.Visible = false; } else { errorAcadimic.Text = "التوقيع المدخل خاطئ او كلمة المرور"; errorAcadimic.Visible = true; } }
protected void btnSaveDean_Click(object sender, EventArgs e) { bool Result = false; int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = labDate.Text.ToString() + labStudentNumber.Text.ToString() + rbtAceptHead.SelectedValue.ToString() + rbtAcceptDean.SelectedValue.ToString(); if (fuSignatureDean.HasFile) { string Private = fuSignatureDean.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("../Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignatureDean.SaveAs(Server.MapPath("../Test") + "/" + fuSignatureDean.FileName); SignatureEmployee newSig = new SignatureEmployee(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { ShowStatusClass obj = new ShowStatusClass(); int id = Convert.ToInt32(Request.QueryString["id"]); int AcceptDean = Convert.ToInt32(rbtAcceptDean.SelectedValue.ToString()); string DeanDec = txtDescriptionDean.Text.ToString(); if (obj.AcceptDeanShowStatus(id, AcceptDean, DeanDec) == 1) { DataRow dr = obj.drgetform(id); int STUid = Convert.ToInt32(dr["StudentID"].ToString()); SentMail s = new SentMail(); s.sendemailStudent(STUid); Response.Redirect("ProcessRequest2.aspx"); } errorDean.Visible = false; } else { errorDean.Text = "التوقيع المدخل خاطئ او كلمة المرور"; errorDean.Visible = true; } }
protected void btnSave_Click(object sender, EventArgs e) { bool Result = false; //Define Avariable int CourseNum1 = 0; int AlternativeCourseNum1 = 0; string TypeCouseNum1 = ""; string Reason = ""; int row = Convert.ToInt32(Request.QueryString["id"]); int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = txtNumberCourse1.Text.ToString() + txtAlternativeNum1C1.Text.ToString() + labHoursCourse1.Text.ToString() + labHoursAlternative.Text.ToString(); if (fuSignature.HasFile) { string Private = fuSignature.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignature.SaveAs(Server.MapPath("Test") + "/" + fuSignature.FileName); // Path = "/Test/" + fuSignatureStudent.FileName; SignatureStudents newSig = new SignatureStudents(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { //Check input Data if (txtNumberCourse1.Text != String.Empty) { CourseNum1 = Convert.ToInt32(txtNumberCourse1.Text.ToString()); } if (txtAlternativeNum1C1.Text != String.Empty) { AlternativeCourseNum1 = Convert.ToInt32(txtAlternativeNum1C1.Text.ToString()); } if (labTypeCourse1.Text != String.Empty) { TypeCouseNum1 = labTypeCourse1.Text.ToString(); } if (txtReason.Text != String.Empty) { Reason = txtReason.Text.ToString(); } AlternativeSub obj = new AlternativeSub(); NowTimeUniversity timee = new NowTimeUniversity(); DataRow T = timee.drSearchYearANdSemester(); string semester = T["NowSemester"].ToString(); string Year = T["NowYear"].ToString(); string Date1 = labDate.Text.ToString(); if (obj.UpdateAlternativeSubject(row, ID, Year, semester, Date1, CourseNum1, TypeCouseNum1, AlternativeCourseNum1, Reason) == 1) { ddlCourse1.SelectedIndex = -1; ddlAlternativeCourse1.SelectedIndex = -1; txtReason.Text = ""; ddlAlternativeCourse1.SelectedIndex = -1; txtAlternativeNum1C1.Text = ""; txtNumberCourse1.Text = ""; labTypeCourse1.Text = ""; labHoursCourse1.Text = ""; labHoursAlternative.Text = ""; SentMail s = new SentMail(); s.sendemailAcadimic(ID); } errorLabel.Visible = false; } else { errorLabel.Text = "التوقيع المدخل خاطئ أو كلمة المرور"; errorLabel.Visible = true; } }
public bool RegistroMasivo(string rutaArchivo, string ContracEthereumProposal, string NameProposal) { SentMail email = new SentMail(); List <string> contrac = new List <string> { "0x12890d2cce102216644c59daE5baed380d84830c", "0x12890d2cce102216644c59daE5baed380d84830c", "0x12890d2cce102216644c59daE5baed380d84830c", "0x12890d2cce102216644c59daE5baed380d84830c", "0x72bc90bcee4f850e5f746dccf8afc48faff037b2", "0x6ba8d4304efae5edc7942762af0029ff514f8ceb", "0xca11d36c46848c289e9ab6d94ab012b26a5970bf", "0xae63afbac20dfd5a952bb7efe196196c40a7acd0", "0x6b23d35cfd1ce9c95b52e5cbfdc2ee1ffdec6a93", "0xdd3a891ca6ec6fe35ab69f42707c762868f7edf6", "0xd9708db1b7749e6ed3f4bdcb01ee033fe26f9da4", "0x34a4bab52953d436861d893a0d0133ab84d96c56" }; System.IO.StreamReader objReader = new System.IO.StreamReader(rutaArchivo); string sLine = ""; System.Collections.ArrayList arrText = new System.Collections.ArrayList(); while (sLine != null) { sLine = objReader.ReadLine(); if (sLine != null) { arrText.Add(sLine); } } objReader.Close(); List <string> correos = new List <string>(); foreach (string sOutput in arrText) { correos.AddRange(sOutput.Split(';')); } foreach (var item in correos) { if (!IsValidEmail(item)) { return(false); } } using (ProposalDataAccess propasalDataAccess = new ProposalDataAccess()) { using (UserDataAccess userDataAccess = new UserDataAccess()) { foreach (var item in correos) { string AccountNumber = contrac[0]; UserModel user = new UserModel() { Profile = 3, Email = item, Password = GenaratorPass(), IsFirstLogger = EnumRegister.NoRegister, }; contrac.Remove(AccountNumber); List <UserModel> list = userDataAccess.SearchUser(user.Email); bool isValidUser = false; if (list == null || list.Count == 0) { isValidUser = userDataAccess.InserUser(user); } else { //el usuario existe no se registra isValidUser = true; } if (isValidUser) { isValidUser = propasalDataAccess.InsertProposalUser(ContracEthereumProposal, item); if (list.Count > 0) { string mensaje = "<p>Usted fue invitado a votar a la propuesta " + NameProposal + "</p>" + "<p>Su Usuario es :" + item + "</p>" + "<p>Ruta de acceso: <a href = 'http://raykel.eastus.cloudapp.azure.com/EthereumWeb/' >Ingreso </a> </p>"; email.SentEmail(mensaje, item, "Solicitud de Votación", "Votacion de " + NameProposal); } else { if (isValidUser) { string mensaje = "<p>Usted fue invitado a votar a la propuesta " + NameProposal + "</p>" + "<p>Su Usuario es :" + item + "</p>" + "<p>Su número de token para participar en la votación es : " + user.Password + "</p>" + "<p>Ruta de acceso: <a href='http://raykel.eastus.cloudapp.azure.com/EthereumWeb/' >Ingreso </a></p>"; email.SentEmail(mensaje, item, "Solicitud de Votación", "Votacion de " + NameProposal); } } } } } } return(true); }
//SentMail public void Save(SentMail SentMail) => BaseRepository.Insert <SentMail> (SentMail);
public void Delete(SentMail SentMail) => BaseRepository.Delete <SentMail> (SentMail);
public RequestOtp(IUserProcessor userProcessor, SentMail sentMail, IConnectionProvider connectionProvider) { _userProcessor = userProcessor; s = sentMail; _connectionProvider = connectionProvider; }
public IActionResult SendApplov(string tomail, string site, string date1, string date2, string mailCC) { /*Check Session */ var page = "277"; var typeofuser = ""; var PermisionAction = ""; // CheckSession if (string.IsNullOrEmpty(HttpContext.Session.GetString("Username"))) { Alert("คุณไม่มีสิทธิ์ใช้งานหน้าดังกล่าว", NotificationType.error); return(RedirectToAction("Index", "Home")); } else { typeofuser = HttpContext.Session.GetString("TypeOfUserId"); PermisionAction = HttpContext.Session.GetString("PermisionAction"); if (PermisionHelper.CheckPermision(typeofuser, PermisionAction, page) == false) { Alert("คุณไม่มีสิทธิ์ใช้งานหน้าดังกล่าว", NotificationType.error); return(RedirectToAction("Index", "Home")); } } /*Check Session */ IActionResult response = Unauthorized(); var postedPurchaseInvoicesDATA = QueryData(date1, date2, site); var main = ""; var header = "<h4>รายการใบรับสินค้า(GR) ที่บัญชีตั้งหนี้แล้วของ หน่วยงาน " + site + " มีดังนี้ </h4><br/>"; var headtable = "<table style='border: 1px solid #ddd;border-collapse: collapse;' ><thead><tr>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>PostingDate</th>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Ref_ Receipt No_</th>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Document No.</th>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Order No.</th>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Buy-from Vendor Name</th>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Vendor Invoice No.</th>" + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Amount</th>" // + "<th align ='center' style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>Progress Term</th>" + "</tr>" + "</thead>" + "<tbody id='myTable'>"; foreach (var std in postedPurchaseInvoicesDATA as List <PostedPurchaseInvoices> ) { main += "<tr>" //+ "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.Statuss + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.PostingDate + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.RefReceiptNo + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.DocumentNo + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.OrderNo + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.VendorName + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.VendorInvoiceNo + "</td>" + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;text-align:right'>" + std.Amount.ToString("#,##0.00") + "</td>" // + "<td style='border: 1px solid #ddd;border-collapse: collapse;padding: 8px 16px;'>" + std.ProgressTerm + "</td >" + "</tr>"; } var table = headtable + main + "</tbody></table> </br>" /*+ bodyfile*/; var datamail = header + table; var checksucess = 0; var mailto = tomail; ///ผู้รับ var form = "*****@*****.**"; var toform = form; //ถึงผู้ส่ง var cc = mailCC; var title = "ใบรับสินค้า(GR) ที่บัญชีตั้งหนี้แล้ว"; var body = datamail; var test = SentMail.MailSent(_config["Email:Server"], Int32.Parse(_config["Email:Port"]), bool.Parse(_config["Email:Security"]), "", "", form, mailto + ";" + toform, title, body, cc); if (test == true) { checksucess = 0; } else { checksucess = 1; } response = Ok(new { check = checksucess, mailto = mailto, tomail = tomail, to = toform }); return(response); }
public void Update(SentMail SentMail) => BaseRepository.Update <SentMail> (SentMail);