Controllers/Front/jrfxController.cs

(完整代码) 2KB

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace KeWeb.Controllers.Front
{
    public class jrfxController : Controller
    {
        //
        // GET: /jrfx/

        public ActionResult Index()
        {
            string sql = "select * from concept";
            DataTable dt = SqlHelper.ExecuteDataTable(sql);
            ViewData["concept"]=dt;
            return View();
        }
        public ActionResult rczp()
        {
            string sql = "select * from job";
            DataTable dt = SqlHelper.ExecuteDataTable(sql);
            ViewData["job"] = dt;
            return View();
        }
        public ActionResult tdjl() {
          
             if (Request["id"]!= null)
             {
                 int id = int.Parse(Request["id"].ToString());
              string sql = "select * from job where id=@id";
            DataTable dt = SqlHelper.ExecuteDataTable(sql,new SqlParameter("@id",id));
            ViewData["job"] = dt;
            return View();
            }else{
                return RedirectToAction("rczp", "jrfx");
            }
          
        }
        public ActionResult Save() {
            string name=Request["name"].ToString();
            string sex = Request["sex"].ToString();
            string age = Request["age"].ToString();
            string grade = Request["grade"].ToString();
            string tc = Request["tc"].ToString();
            string phone = Request["phone"].ToString();
            string grjj = Request["grjj"].ToString();
            string sql = "insert into mailing(Name,Age,Sex,School,Spec,Phone,Personal)values(@Name,@Age,@Sex,@School,@Spec,@Phone,@Personal)";
            SqlHelper.ExecuteNonQuery(sql, new SqlParameter("@Name", name), new SqlParameter("@Age", age), new SqlParameter("@Sex", sex), new SqlParameter("@School", grade), new SqlParameter("@Spec", tc), new SqlParameter("@Phone", phone), new SqlParameter("@Personal", grjj));
            return Content("申请成功");
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。