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 报工平台资源保存 /// /// 报工平台资源保存 /// /// /// [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 } }