AleserviceController- AppointmentController

2.1、 预约安排

2.1.1、 //ViewBag:获取动态视图数据字典

2.1.2、 //无法获取session 重定向到登录界面 重新登录

  1. AleserviceController 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace QXQPS.Areas.MechanicsManagment.Controllers

{

    public class AleserviceController : Controller

    {

        // GET: MechanicsManagment/Aleservice

        public ActionResult Aleservice()//

    1. 售后服务

        {

            return View();

        }

    }

}

  1. AppointmentController 

using QXQPS.Models;

using QXQPS.Vo;

using System;

using System.Collections;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace QXQPS.Areas.MechanicsManagment.Controllers

{

    public class AppointmentController : Controller

    {

        // GET: MechanicsManagment/Appointment

        Models.QXQPEntities myModels = new Models.QXQPEntities();

    1. 预约安排

        public ActionResult Appointment()//预约安排

        {

            try

            {

                ViewBag.UserName = Session["UserName"].ToString().Trim();

      1. //ViewBag:获取动态视图数据字典

                return View();

            }

            catch (Exception)

            {

      1.                 //无法获取session 重定向到登录界面 重新登录

                return Redirect("/Home/Login");

            }

        }

    1. 审核预约单

        public ActionResult ToAudit(int PredateID)//审核预约单

        {

            try

            {

                var list = myModels.PW_Predate.Where(m => m.PredateID == PredateID).Single();

                list.ToAudit = true;

                myModels.Entry(list).State = System.Data.Entity.EntityState.Modified;

                myModels.SaveChanges();

            }

            catch (Exception)

            {

                return Json(false, JsonRequestBehavior.AllowGet);

            }

            return Json(true, JsonRequestBehavior.AllowGet);

        }

上一篇:螺蛳壳里做道场:老破机搭建的私人数据中心---Centos下Docker学习06(Docker网络连接)


下一篇:c语言实例 068