Example #1
0
        public JsonResult SubmitOrder(CourseOrder model)
        {
            if (model == null)
            {
                return(Error("参数错误"));
            }
            if (string.IsNullOrEmpty(model.Name))
            {
                return(Error("请选择您计划去的国家"));
            }

            if (string.IsNullOrEmpty(model.Name))
            {
                return(Error("请选择您计划学的专业"));
            }
            if (string.IsNullOrEmpty(model.Name))
            {
                return(Error("请输入您的姓名"));
            }
            if (string.IsNullOrEmpty(model.Name))
            {
                return(Error("请输入您的手机号"));
            }
            var result = new ResultBase();

            result.success = _courseOrderService.InsertAsync(model);
            return(Json(result));
        }
Example #2
0
        public JsonResult SubmitOrder(CourseOrder model)
        {
            if (model == null)
            {
                return(Error("参数错误"));
            }
            if (model.MajorId == 0)
            {
                return(Error("请选择您计划学的专业"));
            }
            if (string.IsNullOrEmpty(model.Name))
            {
                return(Error("请输入您的姓名"));
            }
            if (string.IsNullOrEmpty(model.Phone))
            {
                return(Error("请输入您的微信号"));
            }
            var result = new ResultBase();

            result.success = _courseOrderService.InsertAsync(model);
            if (result.success)
            {
                result.success = _mailInfoService.SendMail("课程预约", model.Country.GetDescription(), model.MajorId, model.Name, model.Phone, model.Email, "",
                                                           new List <string>(), System.Web.HttpContext.Current.Server.MapPath("/"));
            }
            return(Json(result));
        }