public void GuiMailXacNhan_ThemThanhVien(EntityUser NguoiGui, EntityUser NguoiNhan,EntityDuAn duan, string HasCode) { string[] mang = Request.Url.AbsoluteUri.ToString().Split('/'); string url = mang[0] + "//" + mang[2]; string linkduan = url+"/" + Url.Action("ChiTietDuAn", "DuAn", new { Title = Utilities.Paste_Int64(Utilities.Encode(duan.TenDuAn.ToString()), duan.Id) }); string linkkichhoat = url + "/" + Url.Action("kichhoat_team", "Account", new { HasCode = HasCode }); StringBuilder mailBody = new StringBuilder(); mailBody.AppendFormat("<h1>[FirstStep]-Xác nhận thêm thành viên</h1>"); mailBody.AppendFormat("<br />"); mailBody.AppendFormat("<p> Chào : " + " " + NguoiNhan.HoTen + " ! " + "</p>"); mailBody.AppendFormat("<p>Một thành viên của <a href=\"http://firststep.vn\">FirstStep</a> đã thêm bạn vào team của dự án : " + " <a href=\"" + linkduan + "\">" + duan.TenDuAn + "</a> " + "</p>"); mailBody.AppendFormat("<p>Bạn vui lòng nhấp vào link này để xác nhận, nếu bạn không đồng ý xin đừng làm gì: " + " <a href=\"" + linkkichhoat + "\">" + linkkichhoat + "</a> " + "</p>"); mailBody.AppendFormat("<br></br>"); mailBody.AppendFormat("<p>Không trả lời thư vào email này ! Xin cảm ơn.</p>"); MailHelper.SendMailMessage("*****@*****.**", NguoiNhan.Email, null, null, "[FirstStep]-Xác nhận thêm thành viên", mailBody.ToString(), "smtp.gmail.com", true, "*****@*****.**", "!@#Hien4567"); }
public ActionResult TaoDuAn(DuAnModel daModel) { try { ViewBag.DanhMuc = db.EntityDanhMucs.Where(g => g.IdRoot == 1).ToList(); if (ModelState.IsValid) { int idlogin = Convert.ToInt16(Request.Cookies["ftid"].Value); EntityThongTinTaiKhoan thongtin = new EntityThongTinTaiKhoan(); db.EntityThongTinTaiKhoans.InsertOnSubmit(thongtin); db.SubmitChanges(); EntityDuAn duan = new EntityDuAn(); duan.LoaiHinhGoiVon = daModel.Loaihinhkeugoivon; duan.TenDuAn = daModel.TenDuAn; duan.IdDanhMuc = daModel.IdDanhMuc; duan.TienDauTuMucTieu = daModel.TienDauTuMucTieu; duan.IdUser = idlogin; duan.TrangThai = -1; duan.ThongTinWhichPerson = daModel.whichpreson; duan.IdThongTinTaiKhoan = thongtin.Id; db.EntityDuAns.InsertOnSubmit(duan); db.SubmitChanges(); HoatDongModel.GetListFriend_Sent_HoatDong(idlogin, duan.Id, 3);// tạo dự án return RedirectToAction("TaoDuAn_Buoc2", "DuAn", new { Id = duan.Id }); } } catch { //return RedirectToAction("Index", "Error", new { id = 500 }); } return View(daModel); }