コード例 #1
0
    public bool Save()
    {
        tblInquiry objInquiry = new tblInquiry();

        objInquiry.AddNew();
        objInquiry.s_AppName            = txtName.Text;
        objInquiry.s_AppEmail           = txtEmail.Text;
        objInquiry.s_AppMobile          = txtMobile.Text;
        objInquiry.s_AppMessage         = txtMessage.Text;
        objInquiry.s_AppProductDetailID = hdnProductDetailId.Value;
        objInquiry.Save();
        objInquiry = null;

        clsCommon objCommon  = new clsCommon();
        string    StrBody    = "";
        string    strSubject = "Inquiry";

        StrBody = objCommon.readFile(Server.MapPath("~/EmailTemplates/Inquiry.html"));
        StrBody = StrBody.Replace("`name`", txtName.Text);
        StrBody = StrBody.Replace("`mobileno`", txtMobile.Text);
        StrBody = StrBody.Replace("`email`", txtEmail.Text);
        StrBody = StrBody.Replace("`message`", txtMessage.Text);
        objCommon.SendMail("", strSubject, StrBody);

        objCommon = null;
        return(true);
    }
コード例 #2
0
    private bool Delete(int intPKID)
    {
        bool retval = false;

        objInquiry = new tblInquiry();
        if (objInquiry.LoadByPrimaryKey(intPKID))
        {
            objInquiry.MarkAsDeleted();
            objInquiry.Save();
        }
        retval     = true;
        objInquiry = null;
        return(retval);
    }