using NFine.Application.WMS;
using NFine.Code;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace NFine.Web.Areas.WMS.Controllers
{
///
/// 红字采购入库
///
public class ICSPurchaseReceiveController : ControllerBase
{
ICSPurchaseReceiveApp App = new ICSPurchaseReceiveApp();
// GET: WMS/ICSPurchaseReceive
public ActionResult ICSPurchaseReceiveApplyNeg()
{
return View();
}
public ActionResult ICSPurchaseReceiveApplyNegAdd()
{
return View();
}
public ActionResult ICSPurchaseReceiveApplyNegUpdate()
{
return View();
}
public ActionResult SeachICSPurchaseReceive()
{
return View();
}
public ActionResult SeachInventory()
{
return View();
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetPurchaseReceiveApplyNegDetail(string ApplyNegCode, Pagination pagination)
{
DataTable ListData = App.GetPurchaseReceiveApplyNegDetail(ApplyNegCode, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteICSPurchaseReceiveApplyNeg(string keyValue)
{
string msg = App.DeleteICSPurchaseReceiveApplyNeg(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("删除成功!");
}
else
{
return Error(msg);
}
}
///
/// 汇总
///
///
///
[HttpGet]
public ActionResult GetPurchaseReceiveApplyNeg(Pagination pagination)
{
DataTable ListData = App.GetPurchaseReceiveApplyNeg(ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 修改弹出框的数据来源
///
///
///
///
public ActionResult GetICSPurchaseReceiveReturnTemporary(string RCVCode, Pagination pagination)
{
DataTable table = App.GetICSPurchaseReceiveReturnTemporary(RCVCode);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = table
};
return Content(JsonData.ToJson());
}
public ActionResult GetOOCode(string WorkPoint)
{
try
{
string Code = App.GetCode(WorkPoint);
var JsonData = new
{
Code = Code,
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
///
/// 新增和修改
///
///
///
[HttpPost]
[HandlerAjaxOnly]
public ActionResult SaveICSPurchaseReceiveApplyNeg(string keyValue, string deleteIDs)
{
string msg = App.SaveICSPurchaseReceiveApplyNeg(keyValue, deleteIDs);
if (!string.IsNullOrEmpty(msg))
{
return Error(msg);
}
else
{
return Success("保存成功!");
}
}
/////
///// 新增
/////
/////
/////
//[HttpPost]
//[HandlerAjaxOnly]
//public ActionResult SaveICSPurchaseReceiveApplyNeg(string ICSASN)
//{
// string msg = App.SaveICSPurchaseReceiveApplyNeg(ICSASN);
// if (!string.IsNullOrEmpty(msg))
// {
// return Error(msg);
// }
// else
// {
// return Success("添加成功!");
// }
//}
/////
///// 修改
/////
/////
/////
//[HttpPost]
//[HandlerAjaxOnly]
//public ActionResult UpdateICSPurchaseReceiveApplyNeg(string ICSASN)
//{
// string msg = App.SaveICSPurchaseReceiveApplyNeg(ICSASN);
// if (!string.IsNullOrEmpty(msg))
// {
// return Error(msg);
// }
// else
// {
// return Success("修改成功!");
// }
//}
}
}