using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Estsh.Web.Util;
using System.Collections;
using Estsh.Web.Service;
using System.Data;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
/***************************************************************************************************
*
* 作者:王勇
*
* *************************************************************************************************/
namespace Estsh.Core.Web.Controllers
{
///
/// 目视单打印模块的控制类
///
public partial class ProdOrderReleaseController : Controller
{
private ProdOrderReleaseService service = new ProdOrderReleaseService();
public ActionResult Index()
{
return View();
}
#region 发运单打印
public ActionResult getStockOrderListByPage(Pager pager, String direction, String sort, string cbCustPDLine)
{
if (string.IsNullOrEmpty(cbCustPDLine) || cbCustPDLine == "null")
{
cbCustPDLine = "0";
}
Hashtable result = new Hashtable();
result.Add("pager.pageNo", pager.pageNo);
Hashtable dataHt = this.service.getStockOrderListByPage(pager, direction, sort, cbCustPDLine);
result.Add("rows", dataHt["dataList"]);
result.Add("pager.totalRows", dataHt["totalCount"]);
result.Add("sort", sort);
result.Add("direction", direction);
return Json(result);
}
public ActionResult getStockOrderDetailByPage(Pager pager, String direction, int order_id)
{
Hashtable result = new Hashtable();
result.Add("pager.pageNo", pager.pageNo);
if (order_id == null)
{
order_id = 0;
}
Hashtable dataHt = this.service.getStockOrderDetailByPage(pager, direction, order_id);
result.Add("rows", dataHt["dataList"]);
result.Add("direction", direction);
return Json(result);
}
public ActionResult updatePrintData(string order_id)
{
if (string.IsNullOrEmpty(order_id))
{
return Json("数据不正确,请联系管理员!");
}
order_id = order_id.Substring(0, order_id.Length - 1);
Hashtable result = new Hashtable();
result = this.service.updatePrintData(order_id);
return Json(result, JsonRequestBehavior.AllowGet);
//return Json(result);
}
///
/// 获取客户产线列表
///
///
public ActionResult GetCustPDLine()
{
Hashtable result = new Hashtable();
ArrayList list = this.service.GetCustPDLine();
result.Add("list", list);
return Json(result, JsonRequestBehavior.AllowGet);
}
public ActionResult uploadFile(String cbCustPDLine)
{
ViewData.Add("cbCustPDLine", cbCustPDLine);
return View("~/Views/ProdOrderRelease/uploadFile.aspx");
}
///
/// 导入
///
///
public ActionResult importStockOrderInfo()
{
String cbCustPDLine = Request["cbCustPDLine"].ToString();
Hashtable result = new Hashtable();
HttpPostedFileBase userDataFile = Request.Files[0];
if (userDataFile == null)
{
return null;
}
result = service.ReadExcelFile(userDataFile.InputStream, cbCustPDLine);
return Json(result);
}
public ActionResult releaseOrder(string cbCustPDLine, string cbShift, string qty)
{
if (string.IsNullOrEmpty(cbCustPDLine) || cbCustPDLine == "null")
{
cbCustPDLine = "0";
}
Hashtable result = new Hashtable();
string str = this.service.releaseOrder(cbCustPDLine, cbShift, qty);
result.Add("data", str);
return Json(result, JsonRequestBehavior.AllowGet);
}
#endregion
}
}