Beispiel #1
0
        public String GetSaveStock(string MATNR, string WERKS)
        {
            QueryMaterialPriceInfoClient client = new QueryMaterialPriceInfoClient();

            client.ClientCredentials.UserName.UserName = System.Configuration.ConfigurationManager.AppSettings["SAP_WEBSERVICE_USERNAME"];
            client.ClientCredentials.UserName.Password = System.Configuration.ConfigurationManager.AppSettings["SAP_WEBSERVICE_PASSWORD"];

            MaterialPriceInfoQuery_sync param = new MaterialPriceInfoQuery_sync();

            param.MATNR = MATNR;
            param.WERKS = WERKS;

            MaterialPriceInfoResponse_sync respone = client.MaterialPriceInfoQueryResponse_In(param);

            string maktx = string.Empty;

            if (respone != null && respone.MaterialPriceList != null)
            {
                maktx = respone.MaterialPriceList.FirstOrDefault().MAKTX;
            }

            return(maktx);
        }
Beispiel #2
0
        public List <Domain.MaterialPriceInfo> GetMaterialPriceInforListAll(string burks, string matnr)
        {
            List <Domain.MaterialPriceInfo> list = new List <Domain.MaterialPriceInfo>();

            Domain.MaterialPriceInfo dto = null;

            QueryMaterialPriceInfoClient client = new QueryMaterialPriceInfoClient();

            client.ClientCredentials.UserName.UserName = System.Configuration.ConfigurationManager.AppSettings["SAP_WEBSERVICE_USERNAME"];
            client.ClientCredentials.UserName.Password = System.Configuration.ConfigurationManager.AppSettings["SAP_WEBSERVICE_PASSWORD"];

            MaterialPriceInfoAllQuery_sync param = new MaterialPriceInfoAllQuery_sync();

            param.BUKRS = burks;
            param.MATNR = matnr;

            MaterialPriceInfoResponse_sync respone = client.MaterialPriceInfoAllQueryResponse_In(param);

            if (respone != null && respone.MaterialPriceList != null)
            {
                foreach (MaterialPriceList item in respone.MaterialPriceList)
                {
                    dto               = new Domain.MaterialPriceInfo();
                    dto.bISMT         = item.BISMT;
                    dto.dATAB         = item.DATAB;
                    dto.dPTPR         = item.DPTPR;
                    dto.eAN11         = item.EAN11;
                    dto.eKGRP         = item.EKGRP;
                    dto.gESME         = item.GESME;
                    dto.gUBUN         = item.GUBUN;
                    dto.gUBUN_T       = item.GUBUN_T;
                    dto.kONWA         = item.KONWA;
                    dto.lABST         = item.LABST;
                    dto.lABST_1       = item.LABST_1;
                    dto.mAKTX         = item.MAKTX;
                    dto.mATNR         = item.MATNR;
                    dto.mATNR1        = item.MATNR1;
                    dto.mEINS         = item.MEINS;
                    dto.nOCTL         = item.NOCTL;
                    dto.pERNO         = item.PERNO;
                    dto.pRICE         = item.PRICE;
                    dto.sTPRC         = item.STPRC;
                    dto.tOQTY         = item.TOQTY;
                    dto.tOTAL         = item.TOTAL;
                    dto.wERKS         = item.WERKS;
                    dto.zCNT          = item.ZCNT;
                    dto.zFLAG         = item.ZFLAG;
                    dto.zFLAG_T       = item.ZFLAG_T;
                    dto.zRSUM         = item.ZRSUM;
                    dto.Flag          = respone.Flag;
                    dto.ReturnMessage = respone.ReturnMessage;

                    list.Add(dto);
                }
            }
            else
            {
                dto               = new Domain.MaterialPriceInfo();
                dto.Flag          = respone.Flag;
                dto.ReturnMessage = respone.ReturnMessage;
                list.Add(dto);
            }


            return(list);
        }