コード例 #1
0
ファイル: CommunityController.cs プロジェクト: thaonh134/SSKD
        //Bill checkout
        public async Task <ActionResult> SaveContactRequest(FE_ContactRequest Item)
        {
            //valid
            if (DefaultView.GetRandomCapcha() != Item.CaptchaCode)
            {
                return(Json(new { success = false, message = "Mã xác minh không đúng." }));
            }
            var userID = ViewData["AuthUser"] == null ? 0 : ((AuthUser)ViewData["AuthUser"]).entryid;

            int resutl = FE_ContactRequest.SaveContactRequest(userID, Item);

            //send email
            string subject = "[sskd] - vừa có 1 đơn hàng mới";

            //send ContactEmail
            await sendContactEmail(new List <string>() { ConfigurationManager.AppSettings.Get("EmailContact").ToString() }, subject, Item);

            return(Json(new { success = resutl > 0 }));
        }
コード例 #2
0
        public async Task <ActionResult> SaveContactRequest(FE_ContactRequest Item)
        {
            //valid
            if (DefaultView.GetRandomCapcha() != Item.CaptchaCode)
            {
                return(Json(new { success = false, message = "Mã xác minh không đúng." }));
            }
            var userID = ViewData["AuthUser"] == null ? 0 : ((AuthUser)ViewData["AuthUser"]).entryid;

            Item.Address = Item.Address ?? "";
            int resutl = FE_ContactRequest.SaveContactRequest(userID, Item);
            //string subject = "[Contact] Thông tin liên hệ";
            string subject = "[" + ((TopicContact)Item.TopicContact).DescriptionAttr().ToString() + "]";

            subject += " - " + Item.EntryName ?? "";
            //send ContactEmail
            await sendContactEmail(new List <string>() { ConfigurationManager.AppSettings.Get("EmailContact").ToString() }, subject, Item);

            return(Json(new { success = resutl > 0 }));
        }