1
llj
3 小时以前 015007027feae62b326a089f2b216e902043b021
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.Http;
using WebAPI.Models;
using WebAPI.Controllers.SCGL.日计划管理;
using System.IO;
using System.Linq;
using System.Text;
 
namespace WebAPI.Controllers.成本管理
{
    public class CB_ActualItemMoneyCostController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        //public DAL.ClsCB_ItemMoneyBillMain BillOld = new DAL.ClsCB_ItemMoneyBillMain();
        //public DAL.ClsCB_ItemMoneyBillMain BillNew0 = new DAL.ClsCB_ItemMoneyBillMain();
 
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
 
 
        #region 
        [Route("CB_ActualItemMoneyCostController/CB_ActualItemMoneyCostList")]
        [HttpGet]
        public object CB_ActualItemMoneyCostList(string sWhere)
        {
            try
            {
                ds = oCN.RunProcReturn(sWhere, "WindowPrint");
                List<object> columnNameList = new List<object>();
                //客户制定
                string sErr = "";
                //if (oSystemParameter.ShowBill(ref sErr))
                //{
                //    if (oSystemParameter.omodel.WMS_CampanyName == "乔一")
                //    {
                //        if (ds.Tables[0].Columns.Count > 8)
                //        {
                //            LogService.CustomWriteLog("单据号:" + ds.Tables[0].Rows[0][7].ToString(), "CS" + DateTime.Now.ToString("yyyyMMdd"));
                //        }
                //    }
 
                //}
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
 
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "[0000-1-037]Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}