public static string GetItemAllName(CCDetailInfo detailInfo) { string display_name = string.Empty; display_name = string.Format("{0}/{1}", detailInfo.item_code, detailInfo.item_name); if (detailInfo.prop_1_detail_name != null) { display_name += "/" + detailInfo.prop_1_detail_name; } if (detailInfo.prop_2_detail_name != null) { display_name += "/" + detailInfo.prop_2_detail_name; } if (detailInfo.prop_3_detail_name != null) { display_name += "/" + detailInfo.prop_3_detail_name; } if (detailInfo.prop_4_detail_name != null) { display_name += "/" + detailInfo.prop_4_detail_name; } if (detailInfo.prop_5_detail_name != null) { display_name += "/" + detailInfo.prop_5_detail_name; } return(display_name); }
/// <summary> /// 获取商品明细 /// </summary> /// <param name="loggingSessionInfo">登录model</param> /// <param name="order_id">订单标识</param> /// <param name="unit_id">组织标识</param> /// <param name="warehouse_id">门店标识</param> /// <param name="maxRowCount">最大数量</param> /// <param name="startRowIndex">开始数量</param> /// <returns>ccDetailInfo.icount = 总数量 ccDetailInfo.CCDetailInfoList = 商品明细集合</returns> public CCDetailInfo GetCCDetailListStockBalance(LoggingSessionInfo loggingSessionInfo, string order_id, string unit_id, string warehouse_id, int maxRowCount, int startRowIndex) { try { CCDetailInfo ccDetailInfo = new CCDetailInfo(); Hashtable _ht = new Hashtable(); _ht.Add("OrderId", order_id); _ht.Add("UnitId", unit_id); _ht.Add("WarehouseId", warehouse_id); _ht.Add("StartRow", startRowIndex); _ht.Add("EndRow", startRowIndex + maxRowCount); int iCount = ccService.GetStockBalanceCount(_ht); if (iCount > 0) { IList <CCDetailInfo> ccDetailList = new List <CCDetailInfo>(); DataSet ds = new DataSet(); ds = ccService.GetStockBanlanceList(_ht); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { ccDetailList = DataTableToObject.ConvertToList <CCDetailInfo>(ds.Tables[0]); } ccDetailInfo.icount = iCount; ccDetailInfo.CCDetailInfoList = ccDetailList; } return(ccDetailInfo); } catch (Exception ex) { throw (ex); } }
/// <summary> /// 获取商品明细 /// </summary> /// <param name="loggingSessionInfo">登录model</param> /// <param name="order_id">订单标识</param> /// <param name="unit_id">组织标识</param> /// <param name="warehouse_id">门店标识</param> /// <param name="maxRowCount">最大数量</param> /// <param name="startRowIndex">开始数量</param> /// <returns>ccDetailInfo.icount = 总数量 ccDetailInfo.CCDetailInfoList = 商品明细集合</returns> public CCDetailInfo GetCCDetailListStockBalance(LoggingSessionInfo loggingSessionInfo, string order_id, string unit_id, string warehouse_id, int maxRowCount, int startRowIndex) { try { CCDetailInfo ccDetailInfo = new CCDetailInfo(); Hashtable _ht = new Hashtable(); _ht.Add("OrderId", order_id); _ht.Add("UnitId", unit_id); _ht.Add("WarehouseId", warehouse_id); _ht.Add("StartRow", startRowIndex); _ht.Add("EndRow", startRowIndex + maxRowCount); int iCount = cSqlMapper.Instance().QueryForObject <int>("CCDetail.SelectStockBanlanceCount", _ht); IList <CCDetailInfo> ccDetailList = new List <CCDetailInfo>(); ccDetailList = cSqlMapper.Instance().QueryForList <CCDetailInfo>("CCDetail.SelectStockBanlance", _ht); ccDetailInfo.icount = iCount; ccDetailInfo.CCDetailInfoList = ccDetailList; return(ccDetailInfo); } catch (Exception ex) { throw (ex); } }
//保存ItemDetailList数据。 private IList <CCDetailInfo> saveItemDetailList() { IList <CCDetailInfo> detail = new List <CCDetailInfo>(); var obj = (object[])new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(this.hidInout.Value); for (int i = 0; i < obj.Length; i++) { var dic = (Dictionary <string, object>)obj[i]; var item = new CCDetailInfo(); foreach (var key in dic) { switch (key.Key) { case "item_name": { item.item_name = (key.Value ?? "").ToString(); } break; case "item_code": item.item_code = (key.Value ?? "").ToString(); break; case "prop_1_detail_name": item.prop_1_detail_name = (key.Value ?? "").ToString(); break; case "prop_2_detail_name": item.prop_2_detail_name = (key.Value ?? "").ToString(); break; case "prop_3_detail_name": item.prop_3_detail_name = (key.Value ?? "").ToString(); break; case "prop_4_detail_name": item.prop_4_detail_name = (key.Value ?? "").ToString(); break; case "prop_5_detail_name": item.prop_5_detail_name = (key.Value ?? "").ToString(); break; case "order_detail_id": item.order_detail_id = key.Value == null ? null : key.Value.ToString(); break; case "sku_id": item.sku_id = key.Value == null ? null : key.Value.ToString(); break; case "order_qty": item.order_qty = Convert.ToDecimal(key.Value ?? "0"); break; case "end_qty": item.end_qty = Convert.ToDecimal(key.Value ?? "0"); break; case "difference_qty": item.difference_qty = Convert.ToDecimal(key.Value ?? "0"); break; case "warehouse_id": item.warehouse_id = (key.Value ?? "").ToString(); break; } } detail.Add(item); } return(detail); }
/// <summary> /// 获取库存盘点单明细 /// </summary> public string GetCcDetailInfoById() { var ccService = new CCService(CurrentUserInfo); IList <CCDetailInfo> data = null; string content = string.Empty; string order_id = string.Empty; string unit_id = string.Empty; string warehouse_id = string.Empty; if (FormatParamValue(Request("order_id")) != null && FormatParamValue(Request("order_id")) != string.Empty) { order_id = FormatParamValue(Request("order_id")).ToString().Trim(); } if (FormatParamValue(Request("unit_id")) != null && FormatParamValue(Request("unit_id")) != string.Empty) { unit_id = FormatParamValue(Request("unit_id")).ToString().Trim(); } if (FormatParamValue(Request("warehouse_id")) != null && FormatParamValue(Request("warehouse_id")) != string.Empty) { warehouse_id = FormatParamValue(Request("warehouse_id")).ToString().Trim(); } int maxRowCount = 100000; int startRowIndex = 0; if (order_id == null || order_id.Trim().Length == 0) { order_id = string.Empty; } CCInfo order = null; CCDetailInfo dataStock = null; if (order_id.Trim().Length > 0) { order = ccService.GetCCDetailInfoByOrderId(order_id, maxRowCount, startRowIndex); } else if (unit_id.Trim().Length > 0 && warehouse_id.Trim().Length > 0) { dataStock = ccService.GetCCDetailListStockBalance(CurrentUserInfo, order_id, unit_id, warehouse_id, maxRowCount, startRowIndex); } if (order != null) { data = order.CCDetailInfoList; foreach (var detailItem in order.CCDetailInfoList) { detailItem.display_name = SkuService.GetItemAllName(detailItem); } } else if (dataStock != null) { data = dataStock.CCDetailInfoList; foreach (var detailItem in dataStock.CCDetailInfoList) { detailItem.display_name = SkuService.GetItemAllName(detailItem); } } content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}", data.ToJSON(), data.Count); return(content); }
/// <summary> /// 检查Mobile CCOrderDetail是否已存在 /// </summary> public bool CheckExistMobileCCOrderDetail(CCDetailInfo model) { int count = MSSqlMapper.Instance().QueryForObject <int>("CC.CheckExistMobileCCOrderDetail", model); return(count > 0 ? true : false); }