Ejemplo n.º 1
0
        /// <summary>
        /// 安排试听
        /// </summary>
        /// <returns></returns>
        public ActionResult AddST()
        {
            AjaxStatusModel ajax = new AjaxStatusModel();

            ajax.status = EnumAjaxStatus.Error;  //默认失败
            ajax.msg    = "获取失败!";               //前台获取,用于显示提示信息
            string apid    = Request["apid"];    //预约单
            string classid = Request["classid"]; //班级号

            if (string.IsNullOrEmpty(apid))
            {
                return(Json(ajax));
            }
            if (EnrollData.GetEnrollPrintByApidAndClassid(apid, classid).Count() > 0)
            {
                ajax.msg = "此资源记录已经预约试听过了,不允许重复报名!";
                return(Json(ajax));
            }
            DataProvider.Entities.Enroll obj = new DataProvider.Entities.Enroll();
            Appointment ap = AppointmentData.GetOneByID(apid);

            obj.ID         = CommonData.DPGetTableMaxId("EN", "ID", "Enroll", 8);
            obj.APID       = apid;
            obj.StudentID  = ap.ApStudentID;
            obj.ClassID    = classid;
            obj.CreatorId  = UserSession.userid;
            obj.CreateTime = DateTime.Now;
            if (EnrollData.Add(obj))//注意时间类型
            {
                ajax.msg    = "预约试听报名成功!";
                ajax.status = EnumAjaxStatus.Success;
            }
            return(Json(ajax));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据ID获取资源单信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult GetAppointmentByID(string id)
        {
            AjaxStatusModel ajax = new AjaxStatusModel();    //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;              //默认失败
            ajax.msg    = "获取失败!";                           //前台获取,用于显示提示信息
            Appointment ap = AppointmentData.GetOneByID(id); //业务层获取底层方法,返回数据

            if (ap != null)
            {
                ajax.data   = ap;//放入数据
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "获取成功!";
            }
            return(Json(ajax));
        }