コード例 #1
0
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public JsonResult Upload()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "新增失败!";                        //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            JObject jsonObj = JObject.Parse(data);
            Picture Picture = new Picture();
            var     ret     = Picture.DPUpLoadFile(jsonObj);

            ClassListJob cla = new ClassListJob();

            cla.Classid     = jsonObj["Classid"].ToString();
            cla.Classindex  = int.Parse(jsonObj["Classindex"].ToString());
            cla.CreatorId   = UserSession.userid;
            cla.CreateTime  = DateTime.Now;
            cla.FileName    = ret["filename"];//文件名称
            cla.ContentType = ret["ContentType"];
            if (AttendaceData.AddClassListJob(cla) > 0)
            {
                ajax.msg    = "上传成功!";
                ajax.status = EnumAjaxStatus.Success;
                ajax.data   = ret;
            }


            return(Json(ajax));
        }
コード例 #2
0
        /// <summary>
        /// 保存考勤
        /// </summary>
        /// <returns></returns>
        public JsonResult saveStudentAttendance()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "保存考勤失败!";                      //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            List <AttendanceRecord> cls = (List <AttendanceRecord>)(JsonConvert.DeserializeObject(data.ToString(), typeof(List <AttendanceRecord>)));

            cls = cls.Where(t => t != null && t.AttendanceTypeID != 1).ToList();
            if (cls.Count() > 0)
            {
                string    _classid    = cls.FirstOrDefault().ClassID;
                int       _classindex = cls.FirstOrDefault().ClassIndex;
                ClassList cl          = ClassListData.GetOneByid(_classid, _classindex);
                if (cl.ClassDate.Date > DateTime.Now.Date)
                {
                    ajax.msg = "你要处理的考勤时间还未发生!";
                    return(Json(ajax));
                }
            }
            if (AttendaceData.saveStudentAttendance(cls, UserSession.userid))
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "保存考勤成功";
            }

            return(Json(ajax));
        }
コード例 #3
0
        public JsonResult getCheckStudentData()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "获取信息失败!";                      //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            vw_ClassAttendanceList cls = (vw_ClassAttendanceList)(JsonConvert.DeserializeObject(data.ToString(), typeof(vw_ClassAttendanceList)));

            List <AttendanceRecord> btn = AttendaceData.getStudentCheck(cls.ClassID, cls.ClassIndex);//业务层获取底层方法,返回数据


            if (btn != null)
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "获取信息成功";
                ajax.data   = new Object[] { btn, CommonData.GetDictionaryList(9).Where(t => t.id != "2" && t.id != "1") };
            }

            return(Json(ajax));
        }
コード例 #4
0
        /// <summary>
        /// 微信端学员考勤
        /// </summary>
        /// <returns></returns>
        public ActionResult SaveStudentAttendance_WX()
        {
            AjaxStatusModel ajax = new AjaxStatusModel();

            ajax.status = EnumAjaxStatus.Error; //默认失败
            ajax.msg    = "保存考勤失败!";            //前台获取,用于显示提示信息
            AttendanceRecord ar = new AttendanceRecord();

            ar.StudentID  = Request["StudentID"].ToString();                         //学员号
            ar.ClassID    = Request["ClassID"].ToString();                           //班级号
            ar.ClassIndex = int.Parse(Request["ClassIndex"].ToString());             //班级索引

            ar.AttendanceTypeID = int.Parse(Request["AttendanceTypeID"].ToString()); //通过哪个按钮触发,正常2,缺勤3,请假4
            if (ar.AttendanceTypeID == 2)                                            //正常考勤才赋值时间
            {
                ar.ClockTime = DateTime.Now;                                         //考勤时间
            }
            else
            {
                ar.ClockTime = null;
            }
            List <AttendanceRecord> cls = new List <AttendanceRecord>();

            cls.Add(ar);
            if (AttendaceData.saveStudentAttendance(cls, UserSession.userid))
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "保存考勤成功";
            }
            return(Json(ajax));
        }
コード例 #5
0
        //public ActionResult FSConnectionInfo()
        //{
        //    return View();
        //}


        /// <summary>
        /// 查询FSConnectionInfo页面详细记录
        /// </summary>
        /// <returns></returns>
        public ActionResult FSConnectionInfo(int ID)
        {
            WX_FSConnectionlistModel model = new WX_FSConnectionlistModel();
            vw_AttendanceRecord      vw_AttendanceRecord = StudentScheduleListData.Getvw_AttendanceRecordByID(ID);//查询学员课程表

            model.FSConnectionInfo = vw_AttendanceRecord;
            model.Enclosure        = AttendaceData.ClassListJob(vw_AttendanceRecord.ClassID, vw_AttendanceRecord.ClassIndex);//业务层获取底层方法,返回数据

            return(View(model));
        }
コード例 #6
0
        /// <summary>
        /// 删除作业附件
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public JsonResult DELETE()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "删除失败!";                        //前台获取,用于显示提示信息
            var data = Request["ID"];                     //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            if (AttendaceData.DELETE_ClassListJob(data) > 0)//注意时间类型,而且需要在前台把所有的值
            {
                ajax.msg    = "删除成功!";
                ajax.status = EnumAjaxStatus.Success;
            }
            return(Json(ajax));
        }
コード例 #7
0
        /// <summary>
        /// 保存学员评价
        /// </summary>
        /// <returns></returns>
        public ActionResult SaveStudentEvalute_WX()
        {
            AjaxStatusModel ajax = new AjaxStatusModel();

            ajax.status = EnumAjaxStatus.Error; //默认失败
            ajax.msg    = "保存考勤失败!";            //前台获取,用于显示提示信息
            AttendanceRecord ar = new AttendanceRecord();

            ar.StudentID  = Request["StudentID"].ToString();             //学员号
            ar.ClassID    = Request["ClassID"].ToString();               //班级号
            ar.ClassIndex = int.Parse(Request["ClassIndex"].ToString()); //班级索引
            ar.Evaluate   = Request["Evaluate"].ToString();              //评价内容
            ar.UpdateTime = DateTime.Now;
            ar.UpdatorId  = UserSessionWX.userid;
            if (AttendaceData.SaveStudentEvalute_WX(ar))
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "保存考勤成功";
            }
            return(Json(ajax));
        }
コード例 #8
0
        /// <summary>
        /// 保存学员评价信息
        /// </summary>
        /// <returns></returns>
        public JsonResult saveStudentEvaluate()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "获取失败!";                        //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            List <vw_StudentEvaluate> btn = (List <vw_StudentEvaluate>)(JsonConvert.DeserializeObject(data.ToString(), typeof(List <vw_StudentEvaluate>)));

            if (AttendaceData.saveStudentEvalute(btn))
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "保存成功";
                ajax.data   = ajax.msg;
            }

            return(Json(ajax));
        }
コード例 #9
0
        public JsonResult StudentEvaluate()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "获取失败!";                        //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            vw_ClassAttendanceList    cls = (vw_ClassAttendanceList)(JsonConvert.DeserializeObject(data.ToString(), typeof(vw_ClassAttendanceList)));
            List <vw_StudentEvaluate> btn = AttendaceData.getStudentEvaluate(cls.ClassID, cls.ClassIndex);//业务层获取底层方法,返回数据

            if (btn != null)
            {
                ajax.data   = btn;//放入数据
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "获取成功!";
            }
            return(Json(ajax));
        }
コード例 #10
0
        /// <summary>
        /// 下载图片
        /// </summary>
        /// <returns></returns>
        public JsonResult ClassListJob()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "获取失败!";                        //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            ClassListJob           cls = new ClassListJob();
            List <vw_ClassListJob> btn = AttendaceData.ClassListJob(cls.Classid, cls.Classindex);//业务层获取底层方法,返回数据

            if (btn != null)
            {
                ajax.data   = btn;//放入数据
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "获取成功!";
            }
            return(Json(ajax));
        }
コード例 #11
0
        /// <summary>
        /// 保存作业内容
        /// </summary>
        /// <returns></returns>
        public JsonResult savClassList()
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "保存失败!";                        //前台获取,用于显示提示信息
            var data = Request["data"];                   //获取前台传递的数据,主要序列化

            if (string.IsNullOrEmpty(data))
            {
                return(Json(ajax));
            }
            ClassList cla = (ClassList)(JsonConvert.DeserializeObject(data.ToString(), typeof(ClassList)));
            int       obj = AttendaceData.UpdateClassList(cla);

            if (obj > 0)
            {
                ajax.status = EnumAjaxStatus.Success;
                ajax.msg    = "保存成功";
                ajax.data   = ajax.msg;
            }

            return(Json(ajax));
        }
コード例 #12
0
        //
        // GET: /AttendanceList/

        public ActionResult AttendanceList(AttendanceSearchModel search)
        {
            AttendanceListViewModel model = new AttendanceListViewModel();

            model.search             = search;                                                                                 //页面的搜索模型
            model.search.PageSize    = 15;                                                                                     //每页显示
            model.search.CurrentPage = Convert.ToInt32(Request["pageindex"]) <= 0 ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页


            //分校下拉项
            List <CommonEntity> ComCodeIL = CommonData.Get_SYS_Company_COMP_Code(UserSession.comcode);//分校

            model.ComCodeIL        = CommonData.Instance.GetBropDownListData_Choice(ComCodeIL);
            model.search.ComCodeIL = CommonData.Instance.GetBropDownListData_Choice(ComCodeIL);


            if (UserSession.comcode != null && UserSession.comcode != "1")
            {
                search.ComCode = UserSession.comcode;//默认查询当前分校的人员
            }

            model.buttonlist = AttendaceData.GetClassAttendanceList(search);
            return(View(model));
        }