//C public IList<GoodsListVO> GetGoodsList( string AuthKey, string serviceURL, int page, int rowCount, string good_name, string good_subName, string good_NickName, string good_maker ) { if (!securityManager.CheckSecurityToken(AuthKey)) { throw new Exception("인증된 사용자가 아닙니다"); } IList<GoodsListVO> GoodsVOList = new List<GoodsListVO>(); //쿼리 작성 string Query = new GoodsQuery().SelectGoodsList(page,rowCount,good_name,good_subName,good_NickName,good_maker); //데이터 구하기 DataTable dt = DBController.getInstance().GetData(serviceURL, Query); //구한 데이터 가공하기 foreach (DataRow dr in dt.Rows) { GoodsListVO goodsVO = new GoodsListVO(); foreach (var prop in typeof(GoodsListVO).GetProperties()) { if (prop.Name=="Item") { continue; } goodsVO[prop.Name] = dr[prop.Name]; } GoodsVOList.Add(goodsVO); } return GoodsVOList; }
public GoodsDetail GetGoodDetail(string AuthKey,string serviceURL,long good_pk) { if (!securityManager.CheckSecurityToken(AuthKey)) { throw new Exception("인증된 사용자가 아닙니다"); } //쿼리 작성 string Query = new GoodsQuery().GoodDetails(good_pk); //데이터 구하기 DataTable dt = DBController.getInstance().GetData(serviceURL,Query); //데이터 가공 GoodsDetail detailMaster = new GoodsDetail(); detailMaster .unitcostList = new List<unitcost>(); detailMaster .good_unit_infoList = new List<good_unit_info>(); detailMaster .goodpartList = new List<goodpart>(); detailMaster .goodsellerList = new List<goodseller>(); foreach (DataRow dr in dt.Rows) { foreach (var prop in typeof(GoodsDetail).GetProperties()) { if (prop.Name=="Item") { continue; } if (prop.Name.Contains("List")) { continue; } if (dr[prop.Name].GetType()==typeof(DBNull)) { continue; } detailMaster[prop.Name] = dr[prop.Name]; }//End of Foreach unitcost unitcost = new unitcost(); good_unit_info good_unit_info = new good_unit_info(); goodpart goodpart = new goodpart(); goodseller goodseller = new goodseller(); foreach (var prop in typeof(unitcost).GetProperties()) { if (prop.Name == "Item") { continue; } if (dr[prop.Name].GetType() == typeof(DBNull)) { continue; } unitcost[prop.Name] = dr[prop.Name]; } foreach (var prop in typeof(good_unit_info).GetProperties()) { if (prop.Name == "Item") { continue; } if (dr[prop.Name].GetType() == typeof(DBNull)) { continue; } good_unit_info[prop.Name] = dr[prop.Name]; } foreach (var prop in typeof(goodpart).GetProperties()) { if (prop.Name == "Item") { continue; } if (dr[prop.Name].GetType() == typeof(DBNull)) { continue; } goodpart[prop.Name] = dr[prop.Name]; } foreach (var prop in typeof(goodseller).GetProperties()) { if (prop.Name == "Item") { continue; } if (dr[prop.Name].GetType() == typeof(DBNull)) { continue; } goodseller[prop.Name] = dr[prop.Name]; } detailMaster.unitcostList.Add(unitcost); detailMaster.good_unit_infoList.Add(good_unit_info); detailMaster.goodpartList.Add(goodpart); detailMaster.goodsellerList.Add(goodseller); }//End of Outer Foreach return detailMaster; }
public long GetGoodsCount( string AuthKey, string serviceURL, string good_name, string good_subName, string good_NickName, string good_maker ) { if (!securityManager.CheckSecurityToken(AuthKey)) { throw new Exception("인증된 사용자가 아닙니다"); } string CountQuery = new GoodsQuery().GetGoodsCount(good_name, good_subName, good_NickName, good_maker); DataTable dt = DBController.getInstance().GetData(serviceURL, CountQuery); long count = Convert.ToInt64(dt.Rows[0][0]); return count; }