using NFine.Application.HGWMS;
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.HGWMS.Controllers
{
public class WMSCreateItemLotController : ControllerBase
{
private WMSCreateItemLotApp App = new WMSCreateItemLotApp();
public ActionResult CreateItemLot()
{
return View();
}
public ActionResult From()
{
return View();
}
public ActionResult UpdateCount()
{
return View();
}
public ActionResult UpdatePrintTemplate()
{
return View();
}
///
/// 获取工单主表数据
///
///
///
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, string isPrint, Pagination pagination)
{
DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, isPrint, 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 SubmitFormChengPing( string keyValue)
{
string msg = App.SubmitFormChengPing( keyValue);
if (msg=="")
{
return Success("生成成功!");
}
else
{
return Error(msg);
}
}
///
/// 删除子件条码信息
///
///
///
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteItemLot(string MOCodes)
{
MOCodes = MOCodes.Substring(1, MOCodes.Length-2);
string msg = App.DeleteItemLot(MOCodes);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("删除成功!");
}
else
{
return Error(msg);
}
}
///
/// 打印子件条码信息
///
///
///
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult PrintViewByLot(string MOCodes, string PrintTemplate)
{
string msg = App.PrintViewByLot(MOCodes,PrintTemplate);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("打印成功!");
}
else
{
return Error(msg);
}
}
///
/// 打印子件条码信息(单个条码)
///
///
///
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult PrintViewByLotSingle(string Lots,int PrintCount,string PrintTemplate)
{
string msg = App.PrintViewByLotSingle(Lots, PrintCount, PrintTemplate);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("打印成功!");
}
else
{
return Error(msg);
}
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetPrintTemplate()
{
string dt = App.GetPrintTemplate();
return Content(dt);
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonChengPingNormal(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonChengPingNormal(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonNormal(string ApplyNegCode, string Sequence, string Type, string isPrint, Pagination pagination)
{
DataTable ListData = App.GetSubGridJsonNormal(ApplyNegCode, Sequence, Type, isPrint, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
}
}