public IHttpActionResult JTEdit(zxjc_t_jstc entity) { try { JTService jts = new JTService(); int ret = jts.Modify(entity); if (ret > 0) { return(Json(new { code = 1, msg = "数据修改成功" })); } else { return(Json(new { code = 0, msg = "数据修改失败" })); } } catch (Exception) { throw; } }
public IHttpActionResult ModifyFileName(dynamic obj) { try { string jtid = (obj.jtid ?? "").ToString(); List <sys_file> files = obj.files != null?obj.files.ToObject <List <sys_file> >() : new List <sys_file>(); string filenames = string.Empty; files.ForEach(t => filenames = filenames + t.filename + ","); if (filenames.Length > 0) { filenames = filenames.Remove(filenames.Length - 1, 1); } sys_user user = CacheManager.Instance().Current_User; JTService jts = new JTService(); zxjc_t_jstc entity = new zxjc_t_jstc() { gcdm = "9100", jtid = jtid, wjlj = filenames, jwdx = files.Sum(t => t.filesize), scry = user.name, scsj = DateTime.Now }; int ret = jts.ModifyFileNames(entity); if (ret > 0) { return(Json(new { code = 1, msg = "文件保存成功" })); } else { return(Json(new { code = 0, msg = "文件保存失败" })); } } catch (Exception) { throw; } }