using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Estsh.Web.Service; using System.Collections; using Estsh.Web.Util; using Estsh.Web.Models; namespace Estsh.Core.Web.Controllers { public class ExceptionHandlingController : Controller { private ExceptionHandlingService service = new ExceptionHandlingService(); // // GET: /ExceptionHandling/ public ActionResult Index() { return View(); } /// /// 获取列表数据 /// /// 查询条件 /// /// 排序方式 /// 排序字段 /// public ActionResult getListByPage(Pager pager, String direction, String sort) { Hashtable result = new Hashtable(); String sql = "0=0 "; if (!string.IsNullOrEmpty(Request["cust_pdline_id"])) { sql += " and cust_pdline='" + Request["cust_pdline_id"].ToString() + "'"; } if (!string.IsNullOrEmpty(Request["order_type"])) { sql += " and status ='" + Request["order_type"].ToString() + "'"; } if (!string.IsNullOrEmpty(Request["order_seq"])) { sql += " and order_seq ='" + Request["order_seq"].ToString() + "'"; } if (!string.IsNullOrEmpty(Request["type_name"])) { sql += " and type_id ='" + Request["type_name"].ToString() + "' "; } if (!string.IsNullOrEmpty(Request["model_name"])) { sql += " and model_part_id ='" + Request["model_name"].ToString() + "' "; } result.Add("pager.pageNo", pager.pageNo); Hashtable dataHt = this.service.getListByPage(sql, pager, direction, sort); result.Add("rows", dataHt["dataList"]); result.Add("pager.totalRows", dataHt["totalCount"]); result.Add("sort", sort); result.Add("direction", direction); return Json(result); } /// /// 获取下客户产线拉列表数据 /// /// public ActionResult Getcust_pdline() { Hashtable result = new Hashtable(); ArrayList menuList = this.service.Getcust_pdline(); result.Add("list", menuList); return Json(result, JsonRequestBehavior.AllowGet); } /// /// 获取下拉列表数据 /// /// public ActionResult GetCarType() { Hashtable result = new Hashtable(); ArrayList menuList = this.service.GetCarType(""); result.Add("list", menuList); return Json(result, JsonRequestBehavior.AllowGet); } /// /// 获取所有车型 /// /// public ActionResult GetModelType() { Hashtable resalt = new Hashtable(); ArrayList modelList = this.service.GetModelType(" and model_type_id='" + Request["parentid"].ToString() + "'"); resalt.Add("list", modelList); return Json(resalt, JsonRequestBehavior.AllowGet); } public ActionResult Edit(string param_id) { Hashtable hs = new Hashtable(); hs = service.getOrderList(" and order_id='" + param_id + "'"); ViewData.Add("editType", "editType"); if (hs != null) { ViewData.Add("order_id", hs["order_id"].ToString()); ViewData.Add("order_seq", hs["order_seq"].ToString()); ViewData.Add("cust_pdline", hs["cust_pdline"].ToString()); ViewData.Add("status", hs["status"].ToString()); ViewData.Add("error_message", hs["error_message"].ToString()); } return View("~/Views/PoExceptionHandling/editExceptionHandling.aspx"); } public ActionResult SaveOrder() { Hashtable resault = new Hashtable(); Hashtable hsparams = new Hashtable(); int userid = ((UserInfo)Session["loginedUser"]).empId; string order_seq = Request["order_seq"].ToString(); string status = Request["status"].ToString(); string error_message = Request["error_message"].ToString(); String editType = Request["editType"].ToString(); hsparams.Add("@status", status); hsparams.Add("@error_message", error_message); hsparams.Add("@order_seq", order_seq); hsparams.Add("@update_userid", userid); String message = string.Empty; if (!string.IsNullOrEmpty(editType) && editType.Equals("editType")) { try { string order_id = Request["order_id"].ToString(); hsparams.Add("@order_id", order_id); int num = service.EditOrder(hsparams); if (num > 0) message = "保存成功"; else message = "保存失败"; } catch (Exception ee) { message = "保存失败," + ee.Message; } } resault.Add("message", message); return Json(resault, JsonRequestBehavior.AllowGet); } } }