コード例 #1
0
ファイル: ClassController.cs プロジェクト: radtek/yiqixicai
        /// <summary>
        /// 保存参与人员
        /// </summary>
        /// <param name="userIds"></param>
        /// <param name="classId"></param>
        /// <returns></returns>
        public JsonResult SaveClassUserList(string userIds, int classId)
        {
            try
            {
                var dataList = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Tr_TrainClassToUser> >(userIds);
                if (dataList.Any())
                {
                    _classManager.BatchDeleteTrainClassToUser(classId);
                    dataList.ForEach(p =>
                    {
                        p.ApproveStatus = 2;
                        p.ApproveTime   = DateTime.Now;
                    });
                    _classManager.AddTrainClassUser(dataList);
                }

                //SendToUser(classId, dataList.Select(p => p.UserId).ToList());

                return(Json(new { result = 1, content = "保存成功" }, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json(new { result = 0, content = "保存失败" }, JsonRequestBehavior.AllowGet));
            }
        }