public void GetOrderType() { int orderId = PageRequest.GetInt("orderId", 0); var dt = new Sys.BLL.OrderType().GetList("OrderId=" + orderId).Tables[0]; //产品类型显示优化 if (dt != null) { foreach (DataRow row in dt.Rows) { if (row["ProductType"].ToString().Equals("1")) { row["ModelId"] = DBNull.Value; row["ModelName"] = ""; row["ModelNum"] = DBNull.Value; } if (row["ProductType"].ToString().Equals("2")) { row["MainModelId"] = DBNull.Value; row["MainModelName"] = ""; row["MainModelNum"] = DBNull.Value; row["SubModelId1"] = DBNull.Value; row["SubModelName1"] = ""; row["SubModelNum1"] = DBNull.Value; row["SubModelId2"] = DBNull.Value; row["SubModelName2"] = ""; row["SubModelNum2"] = DBNull.Value; row["SubModelId3"] = DBNull.Value; row["SubModelName3"] = ""; row["SubModelNum3"] = DBNull.Value; row["SubModelId4"] = DBNull.Value; row["SubModelName4"] = ""; row["SubModelNum4"] = DBNull.Value; } } dt.AcceptChanges(); } var json = PluSoft.Utils.JSON.Encode(dt); Response.Write(json); }
/// <summary> /// 根据UserLoginId获取用户信息和订单信息 /// </summary> /// <param name="dicParams"></param> /// <returns></returns> private Dictionary <string, object> GetOrdersInfo(Dictionary <string, object> dicParams) { Dictionary <string, object> dicResult = new Dictionary <string, object>(); if (!dicParams.ContainsKey("token") || !dicParams.ContainsKey("orderId")) { dicResult.Add("response_id", 0); dicResult.Add("response_msg", "接口缺少参数!"); return(dicResult); } if (!new Sys.BLL.Account().CheckToken(dicParams["token"].ToString())) { dicResult.Add("response_id", 0); dicResult.Add("response_msg", "Token验证失败!"); return(dicResult); } int orderId = Utils.StrToInt(dicParams["orderId"], 0); var orderModel = new Sys.BLL.Orders().GetModel(orderId); var orderTypeList = new Sys.BLL.OrderType().GetModelList("OrderId=" + orderId); var orderFlow = new Sys.BLL.Orders().GetOrderFlowInfo(orderId); if (orderModel == null || orderTypeList == null) { // 失败,返回信息 dicResult.Add("response_id", 0); dicResult.Add("response_msg", "订单明细获取异常!"); } else { dicResult.Add("response_id", 1); dicResult.Add("response_msg", "订单信息获取成功!"); dicResult.Add("order_main", orderModel); dicResult.Add("order_detail", orderTypeList); dicResult.Add("order_flow", orderFlow); } return(dicResult); }