Example #1
0
    private void GuiMail()
    {
        string Username = (string)Request["Username"];
        string subject  = (string)Request["subject"];
        string body     = (string)Request["msgpost"];

        NguoiDungBUS ndBus = new NguoiDungBUS();
        NguoiDungDTO dto   = ndBus.LayThongTinNguoiDung(Username);

        bool            flag   = Utilities.SendMail("*****@*****.**", dto.Email, subject, body) == "";
        NoiDungEmailDTO ndedto = new NoiDungEmailDTO();
        NoiDungEmailBUS bus    = new NoiDungEmailBUS();

        ndedto.TieuDe   = subject;
        ndedto.NoiDung  = body;
        ndedto.Email    = dto.Email;
        ndedto.NgayGui  = DateTime.Now;
        ndedto.Username = Username;

        bool kq = bus.ThemNoiDungEmail(ndedto);

//         XL_THE the = new XL_THE("goc");
//         XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("kq", flag ? "1" : "0");
//         the.Danh_sach_thuoc_tinh.Add(thuoctinh);
//         string chuoi = the.Chuoi();
        string str = flag && kq ? "Gửi mail thành công" : "Không thực hiện được do lỗi server";

        Response.Write("<script type=\"text/javascript\"> alert('" + str + "'); </script>");
    }
Example #2
0
    public bool ThemNoiDungEmail(NoiDungEmailDTO dto)
    {
        SqlCommand cmd = CreateCommandStored("spThemNoiDungEmail",
                                             new string[] { "@UserName", "@Email", "@NgayGui", "@TieuDe", "@NoiDung" },
                                             new object[] { dto.Username, dto.Email, dto.NgayGui, dto.TieuDe, dto.NoiDung });

        return(ExecuteNonQuery(cmd));
    }
Example #3
0
    private void LayNoiDungEmail()
    {
        string strMaMail = (string)Request["MaMail"];

        int             maMail    = int.Parse(strMaMail);
        NoiDungEmailBUS bus       = new NoiDungEmailBUS();
        NoiDungEmailDTO dto       = bus.LayNoiDungEmail(maMail);
        string          str       = HttpUtility.HtmlEncode(dto.NoiDung);
        XL_THE          the       = new XL_THE("goc");
        XL_THUOC_TINH   thuoctinh = new XL_THUOC_TINH("kq", str);

        the.Danh_sach_thuoc_tinh.Add(thuoctinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
Example #4
0
 public bool ThemNoiDungEmail(NoiDungEmailDTO dto)
 {
     return(ndeDAO.ThemNoiDungEmail(dto));
 }