YL
2021-07-13 2c9c63c19194fba07de27f4806c500a04e3486c2
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
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
 
namespace WebAPI.Controllers
{
    public class ReportPlatFormController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
 
        #region 报工平台资源保存
        /// <summary>
        /// 报工平台资源保存
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("ReportPlatForm/SaveGetLineBindBillList")]
        [HttpPost]
        public object SaveGetLineBindBillList(string HUserName,string HSourceID,string HSourceName,string HManagerID,string HManagerName,string HGroupID,string HGroupName,string HCreateDate,string HRemark)
        {
            
            try
            {
                oCN.BeginTran();
                //写入产线绑定
                string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag) 
                                           values('"+HSourceID+"','"+HUserName+"','"+HGroupID+"','"+HManagerID+"','"+HRemark+"','"+DateTime.Parse(HCreateDate).ToShortDateString()+ "','"+HUserName+"','1')");
                oCN.RunProc(sql);
 
                oCN.Commit();
 
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                
            }
            return objJsonResult;
        }
        #endregion
    }
}