Example #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value) || this.hdnRowMasterKey.Value == Constants.INVALID_ID_STRING)
            {
                this.currentEntity = new MaterialPriceList();
            }
            else
            {
                this.currentEntity = this.ownerPage.CostCalculationRef.GetMaterialPriceListById(this.hdnRowMasterKey.Value);

                if (this.currentEntity == null)
                {
                    this.ownerPage.CallContext.ResultCode = ETEMEnums.ResultEnum.Error;

                    base.AddMessage(this.lbResultContext, string.Format("Entity `MaterialPriceList` not found by ID ({0})!", this.hdnRowMasterKey.Value));

                    return;
                }
            }

            this.currentEntity.LME      = BaseHelper.ConvertToDecimalOrMinValue(this.tbxLME.Text.Trim());
            this.currentEntity.Premium  = BaseHelper.ConvertToDecimalOrMinValue(this.tbxPremium.Text.Trim());
            this.currentEntity.DateFrom = this.tbxDateFrom.TextAsDateParseExactOrMinValue;
            this.currentEntity.DateTo   = this.tbxDateTo.TextAsDateParseExact;

            this.ownerPage.CallContext = this.ownerPage.CostCalculationRef.MaterialPriceListSave(new List <MaterialPriceList>()
            {
                this.currentEntity
            }, this.ownerPage.CallContext);

            if (this.ownerPage.CallContext.ResultCode == ETEMEnums.ResultEnum.Success)
            {
                this.hdnRowMasterKey.Value = this.ownerPage.CallContext.EntityID;

                base.AddMessage(this.lbResultContext, this.ownerPage.CallContext.Message);
            }
            else
            {
                if (!ShowErrors(new List <CallContext>()
                {
                    this.ownerPage.CallContext
                }))
                {
                    return;
                }
            }

            if (this.ownerPage is MaterialPricesList)
            {
                ((MaterialPricesList)this.ownerPage).LoadFilteredList();
            }
        }
Example #2
0
        public override void UserControlLoad()
        {
            SetEmptyValues();
            base.ClearResultContext(this.lbResultContext);

            if (this.ownerPage == null)
            {
                throw new UMSException("Current Page is null or is not inheritor of BasicPage.");
            }

            if (!string.IsNullOrEmpty(this.hdnRowMasterKey.Value) && this.hdnRowMasterKey.Value != Constants.INVALID_ID_ZERO_STRING)
            {
                this.CurrentEntityMasterID = this.hdnRowMasterKey.Value;
            }

            InitLoadControls();

            this.currentEntity = this.ownerPage.CostCalculationRef.GetMaterialPriceListById(this.CurrentEntityMasterID);

            if (this.currentEntity != null)
            {
                this.SetHdnField(this.currentEntity.idMaterialPriceList.ToString());

                this.tbxLME.Text     = this.currentEntity.LME_RoundString;
                this.tbxPremium.Text = this.currentEntity.PremiumRoundString;
                this.tbxDateFrom.SetTxbDateTimeValue(this.currentEntity.DateFrom);
                this.tbxDateTo.SetTxbDateTimeValue(this.currentEntity.DateTo);

                base.ClearResultContext(this.lbResultContext);
            }
            else
            {
                SetEmptyValues();
            }

            this.pnlFormData.Visible = true;
            this.pnlFormData.Focus();
        }
Example #3
0
        public Domain.MaterialInforDetail GetMaterialInforDetail(Domain.MaterialPriceInfo materialPrice)
        {
            Domain.MaterialInforDetail returnDto = null;//new Domain.MaterialInforDetail();

            List <Domain.MaterialInforDetail> list = new List <Domain.MaterialInforDetail>();

            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"];

            MaterialInformationQuery_sync param = new MaterialInformationQuery_sync();

            MaterialPriceList dto = new MaterialPriceList();

            dto.BISMT            = materialPrice.bISMT;
            dto.DATAB            = materialPrice.dATAB;
            dto.DATABSpecified   = true;
            dto.DPTPR            = materialPrice.dPTPR;
            dto.DPTPRSpecified   = true;
            dto.EAN11            = materialPrice.eAN11;
            dto.EKGRP            = materialPrice.eKGRP;
            dto.MATNR            = materialPrice.mATNR;
            dto.WERKS            = materialPrice.wERKS;
            dto.GESMESpecified   = true;
            dto.LABST_1Specified = true;
            dto.LABSTSpecified   = true;
            dto.STPRCSpecified   = true;
            dto.TOQTYSpecified   = true;
            dto.TOTALSpecified   = true;
            dto.ZCNTSpecified    = true;


            param.MaterialPriceList = dto;

            MaterialInformationResponse_sync respone = client.MaterialInformationQueryResponse_In(param);

            if (respone != null && respone.MaterialInformationList != null)
            {
                foreach (MaterialInformationList item in respone.MaterialInformationList)
                {
                    returnDto = new Domain.MaterialInforDetail()
                    {
                        bEHVO    = item.BEHVO,
                        bEHVO_T  = item.BEHVO_T,
                        lIFNR    = item.LIFNR,
                        lIFNR_TX = item.LIFNR_TX,
                        mAKTX    = item.MAKTX,
                        mATNR    = item.MATNR,
                        mEINH    = item.MEINH,
                        tAKLV    = item.TAKLV,
                        tAKLV_TX = item.TAKLV_TX,
                        vERPR    = item.VERPR,
                        wAERS    = item.WAERS,
                        zSTD     = item.ZSTD
                    };

                    list.Add(returnDto);
                }
            }

            return(list.FirstOrDefault());
        }
Example #4
0
        public Domain.Message SaveMaterialLabel(Domain.MaterialSaveLabel dto)
        {
            Domain.Message returnMessage = new Domain.Message();

            ManageSaveMaterialLabelClient client = new ManageSaveMaterialLabelClient();

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

            SaveMaterialLabelQuery_sync param = new SaveMaterialLabelQuery_sync();

            MaterialPriceList material = new MaterialPriceList()
            {
                BISMT            = dto.bISMT,
                DATAB            = dto.dATAB,
                DATABSpecified   = true,
                DPTPR            = dto.dPTPR,
                DPTPRSpecified   = true,
                EAN11            = dto.eAN11,
                EKGRP            = dto.eKGRP,
                GESME            = dto.gESME,
                GESMESpecified   = true,
                GUBUN            = dto.gUBUN,
                GUBUN_T          = dto.gUBUN_T,
                KONWA            = dto.kONWA,
                LABST            = dto.lABST,
                LABST_1          = dto.lABST_1,
                LABST_1Specified = true,
                LABSTSpecified   = true,
                MAKTX            = dto.mAKTX,
                MATNR            = dto.mATNR,
                MATNR1           = dto.mATNR1,
                MEINS            = dto.mEINS,
                NOCTL            = dto.nOCTL,
                PERNO            = dto.pERNO,
                PRICE            = dto.pRICE,
                STPRC            = dto.sTPRC,
                STPRCSpecified   = true,
                TOQTY            = dto.tOQTY,
                TOQTYSpecified   = true,
                TOTAL            = dto.tOTAL,
                TOTALSpecified   = true,
                WERKS            = dto.wERKS,
                ZCNT             = dto.zCNT,
                ZCNTSpecified    = true,
                ZFLAG            = dto.zFLAG,
                ZFLAG_T          = dto.zFLAG_T,
                ZRSUM            = dto.zRSUM
            };

            param.MaterialPriceList = material;

            SaveMaterialLabelResponse_sync respone = client.SaveMaterialLabelQueryResponse_In(param);

            if (respone != null)
            {
                returnMessage.Flag          = respone.Flag;
                returnMessage.ReturnMessage = respone.ReturnMessage;
            }

            return(returnMessage);
        }