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.
 
 
 
 
 

214 lines
5.9 KiB

using NFine.Application.DHAY;
using NFine.Code;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection.Emit;
using System.Web;
using System.Web.Mvc;
namespace NFine.Web.Areas.DHAY.Controllers
{
public class ICSAccessoriesMOApplyController : ControllerBase
{
ICSAccessoriesMOIApplyApp App = new ICSAccessoriesMOIApplyApp();
// GET: DHAY/ICSCustomerSuppliedReturn
public ActionResult Index()
{
return View();
}
public ActionResult Create()
{
return View();
}
public ActionResult GetInvCode()
{
return View();
}
public ActionResult Update()
{
return View();
}
public ActionResult GetWHCode()
{
return View();
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteICSMOApply(string keyValue)
{
string msg = App.DeleteICSMOApply(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("删除成功!");
}
else
{
return Error(msg);
}
}
[HttpPost]
[HandlerAjaxOnly]
public ActionResult SaveICSMOApply(string ICSASN)
{
string msg = App.SaveICSMOApply(ICSASN);
if (!string.IsNullOrEmpty(msg))
{
return Error(msg);
}
else
{
return Success("添加成功!");
}
}
[HttpGet]
public ActionResult GetICSMOApply(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetICSMOApply(ref pagination, queryJson);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
public ActionResult GetICSMOApplyByApplyCode(string ApplyCode)
{
DataTable ListData = App.GetICSMOApplyByApplyCode(ApplyCode);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetICSMOApplyDetail(string ApplyCode, string queryJson, Pagination pagination)
{
DataTable ListData = App.GetICSMOApplyDetail(ApplyCode, queryJson, 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 DeleteICSMOApplyByCode(string keyValue)
{
string msg = App.DeleteICSMOApplyByCode(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("删除成功!");
}
else
{
return Error(msg);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult ApproveICSMOApplyByCode(string keyValue)
{
string msg = App.ApproveICSMOApplyByCode(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("审核成功!");
}
else
{
return Error(msg);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult AbandonICSMOApplyByCode(string keyValue)
{
string msg = App.AbandonICSMOApplyByCode(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("操作成功!");
}
else
{
return Error(msg);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult CloseICSMOApplyByCode(string keyValue)
{
string msg = App.CloseICSMOApplyByCode(keyValue);
if (string.IsNullOrEmpty(msg))
{
return Success("关闭成功!");
}
else
{
return Error(msg);
}
}
public ActionResult GetBidCode(string WorkPoint)
{
try
{
string Code = App.GetBidCode(WorkPoint);
var JsonData = new
{
Code = Code,
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpPost]
[HandlerAjaxOnly]
public ActionResult UpdateICSMOApply(string ICSASN)
{
string msg = App.UpdateICSMOApply(ICSASN);
if (!string.IsNullOrEmpty(msg))
{
return Error(msg);
}
else
{
return Success("修改成功!");
}
}
public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
{
DataTable table = App.GetICSReturnTemporary(rfqno);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = table
};
return Content(JsonData.ToJson());
}
}
}