Exemplo n.º 1
0
 public IHttpActionResult edit(zxjc_t_dzgy entity)
 {
     try
     {
         DZGYService dzgys = new DZGYService();
         int         cnt   = dzgys.Modify(entity);
         if (cnt > 0)
         {
             return(Json(new { code = 1, msg = "数据修改成功" }));
         }
         else
         {
             return(Json(new { code = 0, msg = "数据修改失败" }));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 2
0
        public IHttpActionResult ChangeFileName(dynamic obj)
        {
            try
            {
                string          gyid  = (obj.gyid ?? "").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;
                DZGYService dzgys  = new DZGYService();
                zxjc_t_dzgy entity = new zxjc_t_dzgy()
                {
                    gyid = gyid,
                    wjlj = filenames,
                    jwdx = files.Sum(t => t.filesize).ToString(),
                    scry = user.name,
                    scsj = DateTime.Now
                };
                int cnt = dzgys.ModifyFileName(entity);
                if (cnt > 0)
                {
                    return(Json(new { code = 1, msg = "文件上传成功" }));
                }
                else
                {
                    return(Json(new { code = 0, msg = "文件上传失败" }));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }