public ActionResult SaveForm(string keyValue, LllegalPointRecoverEntity entity)
        {
            if (string.IsNullOrEmpty(keyValue))
            {
                entity.RECOVERNUMBER = DateTime.Now.ToString("yyyyMMddHHmmss");
            }
            lllegalpointrecoverbll.SaveForm(keyValue, entity);
            //用户集合
            string userset = Request.Form["userset"];

            if (!string.IsNullOrEmpty(userset))
            {
                JArray jarray = (JArray)JsonConvert.DeserializeObject(userset);
                foreach (JObject rhInfo in jarray)
                {
                    string userid   = rhInfo["userid"].ToString();   //用户id
                    string username = rhInfo["username"].ToString(); //用户姓名
                    string year     = rhInfo["year"].ToString();     //年度
                    LllegalPointRecoverDetailEntity detailEntity = new LllegalPointRecoverDetailEntity();
                    detailEntity.RECOVERUSERID   = userid;
                    detailEntity.RECOVERUSERNAME = username;
                    detailEntity.RECOVERYEAR     = year;
                    detailEntity.RECOVERID       = entity.ID;
                    lllegalpointrecoverdetailbll.SaveForm("", detailEntity); //保存明细
                }
            }
            return(Success("操作成功。"));
        }
Esempio n. 2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, LllegalPointRecoverEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }