ch
2022-05-24 6dddaea7cf513f9a55cc54d06a2a3feca750e4f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Http;
using WebAPI.Models;
 
namespace WebAPI.Controllers.SCGL.日计划管理
{
    public class JIT_DayPlanPlatFormImportController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
        #region 生产日计划导入
        [Route("JIT_DayPlanPlatFormImport/JIT_DayPlanPlatFormImport_DR")]
        [HttpPost]
        public object JIT_DayPlanPlatFormImport_DR(HttpPostedFileBase file)
        {
            try
            {
                if (file != null)
                {
                    NpoiHelper np = new NpoiHelper();
                    DataSet ds = np.ReadExcel(@"C:\Users\Harold\Desktop\新建XLS工作表.xls", 1);
                    DataTable dt = ds.Tables[0];
                }
 
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}