You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
46 lines
1.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web.Http;
|
|
using Warehouse.DAL.Report;
|
|
|
|
namespace Warehouse.WebApi.AddLocation
|
|
{
|
|
public class AddLocationController : ApiController
|
|
{
|
|
AddLocationDal YBSAE = new AddLocationDal();
|
|
[Route("api/AddLocation/AddStock")]
|
|
[HttpPost]
|
|
public IHttpActionResult AddStock(dynamic para)
|
|
{
|
|
dynamic Stand = para.stand;
|
|
string res = YBSAE.AddStock(Stand);
|
|
if (res == "success")
|
|
{
|
|
string sql = @"insert into [wh].[dbo].[tstock](name,area,type,person,phone,address,remark)
|
|
values ('" + Stand + "','','成品仓','','','','')";
|
|
YBSAE.insert_sql1(sql);
|
|
}
|
|
return Json(new { res });
|
|
//return Json(res);
|
|
}
|
|
[Route("api/AddLocation/AddLocation")]
|
|
[HttpPost]
|
|
public IHttpActionResult AddLocation(dynamic para)
|
|
{
|
|
dynamic Stand = para.stand;
|
|
dynamic Location = para.location;
|
|
string res = YBSAE.AddLocation(Stand,Location);
|
|
if (res == "success")
|
|
{
|
|
string sql = @"insert into [wh].[dbo].[tstoragelocation](locationname,stockid,slarea,changeuserid) values ('" + Location[0] + "',' " + Stand[0] + "','','')";
|
|
YBSAE.insert_sql2(sql);
|
|
}
|
|
return Json(new { res });
|
|
//return Json(res);
|
|
}
|
|
}
|
|
|
|
}
|