コード例 #1
0
ファイル: WebService.cs プロジェクト: hesed7/hitpan
        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;
        }
コード例 #2
0
ファイル: WebService.cs プロジェクト: hesed7/hitpan
 //U
 public int UpdateGood(string AuthKey, string query, string serviceURL, GoodsDetail goodInfo)
 {
     if (!securityManager.CheckSecurityToken(AuthKey))
     {
         throw new Exception("인증된 사용자가 아닙니다");
     }
     return 0;
 }