Beispiel #1
0
        public ActionResult AddBatch()
        {
            string month = Request.Params["month"];

            if (month == null)
            {
                return(Json(
                           new OperateResult
                {
                    content = "请输入考核月",
                },
                           JsonRequestBehavior.AllowGet
                           ));
            }
            string data = Request.Params["assessmentData"];

            if (data == null)
            {
                return(Json(
                           new OperateResult
                {
                    content = "无考核数据",
                },
                           JsonRequestBehavior.AllowGet
                           ));
            }

            JavaScriptSerializer  js      = new JavaScriptSerializer();
            List <AssessmentInfo> lstData = js.Deserialize <List <AssessmentInfo> >(data);

            if (lstData.Count == 0)
            {
                return(Json(
                           new OperateResult
                {
                    content = "无考核数据",
                },
                           JsonRequestBehavior.AllowGet
                           ));
            }

            AssessmentManager manager = new AssessmentManager();
            OperateResult     or      = manager.AddBatch(lstData, month);

            return(Json(or, JsonRequestBehavior.AllowGet));
        }