Exemplo n.º 1
0
        public void JTInsert()
        {
            JTService jts = new JTService();

            jts.Add(new Models.BaseInfo.zxjc_t_jstc()
            {
                jtid   = Guid.NewGuid().ToString(),
                jcbh   = "001",
                jcmc   = "关于×××的通知",
                jcms   = "描述",
                jwdx   = 100,
                fpr    = "a",
                fp_flg = "Y",
                fp_sj  = DateTime.Now,
                gcdm   = "9100",
                scpc   = "pc",
                scry   = "admin",
                scsj   = DateTime.Now,
                scx    = "1",
                wjfl   = "fdp",
                wjlj   = "upload/",
                yxqx1  = DateTime.Now,
                yxqx2  = DateTime.Now.AddDays(5)
            });
        }
Exemplo n.º 2
0
 public IHttpActionResult GetJtNumber()
 {
     try
     {
         JTService jts  = new JTService();
         string    jtno = jts.GetJTNumber();
         return(Json(new { code = 1, msg = "ok", jtno = jtno, jtid = Guid.NewGuid().ToString() }));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
 public IHttpActionResult JTList(sys_page parm)
 {
     try
     {
         int       resultcount = 0;
         JTService jts         = new JTService();
         var       list        = jts.Search(parm, out resultcount);
         return(Json(new { code = 1, msg = "ok", list = list, resultcount = resultcount }));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 4
0
 public IHttpActionResult JTDel(List <zxjc_t_jstc> entitys)
 {
     try
     {
         JTService jts = new JTService();
         int       ret = jts.Delete(entitys);
         if (ret > 0)
         {
             return(Json(new { code = 1, msg = "数据删除成功" }));
         }
         else
         {
             return(Json(new { code = 0, msg = "数据删除失败" }));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
        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;
            }
        }
Exemplo n.º 7
0
 public IHttpActionResult ReadNoticeXls(dynamic obj)
 {
     try
     {
         string path     = HttpContext.Current.Server.MapPath("~/UpLoad/");
         string filename = (obj.filename ?? "").ToString();
         if (!string.IsNullOrEmpty(filename))
         {
             string    fullpath = path + filename;
             JTService jts      = new JTService();
             var       list     = jts.FromExcel(fullpath);
             return(Json(new { code = 1, msg = "ok", list = list }));
         }
         else
         {
             return(Json(new { code = 0, msg = "error" }));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }