示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!this.ownerPage.CheckUserActionPermission(ETEMEnums.SecuritySettings.SAPDataQuantitySave, false))
            {
                return;
            }


            if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value) || this.hdnRowMasterKey.Value == Constants.INVALID_ID_STRING)
            {
                this.currentEntity = new SAPDataQuantity();
            }
            else
            {
                this.currentEntity = this.ownerPage.CostCalculationRef.GetSAPDataQuantityById(this.hdnRowMasterKey.Value);

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

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

                    return;
                }
            }

            this.currentEntity.idCostCenter   = this.ddlCostCenter.SelectedValueINT;
            this.currentEntity.idQuantityType = this.ddlQuantityType.SelectedValueINT;
            this.currentEntity.ValueData      = BaseHelper.ConvertToDecimalOrMinValue(this.tbxValueData.Text.Trim());

            this.ownerPage.CallContext = this.ownerPage.CostCalculationRef.SAPDataQuantitySave(new List <SAPDataQuantity>()
            {
                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 SAPDataQuantitiesList)
            {
                ((SAPDataQuantitiesList)this.ownerPage).LoadFilteredList();
            }
        }
示例#2
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 AverageOutturnOverTime();
            }
            else
            {
                this.currentEntity = this.ownerPage.CostCalculationRef.GetAverageOutturnOverTimeById(this.hdnRowMasterKey.Value);

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

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

                    return;
                }
            }
            this.currentEntity.ValueOfPressSMS1 = BaseHelper.ConvertToDecimalOrMinValue(this.tbxValueOfPressSMS1.Text.Trim());
            this.currentEntity.ValueOfPressSMS2 = BaseHelper.ConvertToDecimalOrMinValue(this.tbxValueOfPressSMS2.Text.Trim());

            this.currentEntity.ValueOfPressBREDA  = BaseHelper.ConvertToDecimalOrMinValue(this.tbxValueOfPressBREDA.Text.Trim());
            this.currentEntity.ValueOfPressFARREL = BaseHelper.ConvertToDecimalOrMinValue(this.tbxValueOfPressFARREL.Text.Trim());


            this.currentEntity.DateFrom = this.tbxDateFrom.TextAsDateParseExactOrMinValue;
            this.currentEntity.DateTo   = this.tbxDateTo.TextAsDateParseExact;

            this.ownerPage.CallContext = this.ownerPage.CostCalculationRef.AverageOutturnOverTimeSave(new List <AverageOutturnOverTime>()
            {
                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 AverageOutturnOverTimeList)
            {
                ((AverageOutturnOverTimeList)this.ownerPage).LoadFilteredList();
            }
        }
示例#3
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();
            }
        }
示例#4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!this.ownerPage.CheckUserActionPermission(ETEMEnums.SecuritySettings.ProductivityAndScrapSave, false))
            {
                return;
            }

            bool isNew = true;

            if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value) || this.hdnRowMasterKey.Value == Constants.INVALID_ID_STRING)
            {
                this.currentEntity = new ProductivityAndScrapDetail();
            }
            else
            {
                this.currentEntity = this.ownerPage.CostCalculationRef.GetProductivityAndScrapDetailById(this.hdnRowMasterKey.Value);

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

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

                    return;
                }

                isNew = false;
            }

            this.currentEntity.idCostCenter     = this.ddlCostCenter.SelectedValueINT;
            this.currentEntity.idProfileSetting = this.ddlProfileSetting.SelectedValueINT;
            this.currentEntity.SumOfHours       = BaseHelper.ConvertToDecimalOrMinValue(this.tbxSumOfHours.Text.Trim());
            this.currentEntity.SumOfConsumption = BaseHelper.ConvertToDecimalOrMinValue(this.tbxSumOfConsumption.Text.Trim());
            this.currentEntity.SumOfProduction  = BaseHelper.ConvertToDecimalOrMinValue(this.tbxSumOfProduction.Text.Trim());

            decimal productivityKGh = decimal.Zero;
            decimal scrapRate       = decimal.Zero;

            if (this.currentEntity.SumOfHours.HasValue && this.currentEntity.SumOfHours.Value != 0 &&
                this.currentEntity.SumOfProduction.HasValue)
            {
                productivityKGh = Math.Round((this.currentEntity.SumOfProduction.Value / this.currentEntity.SumOfHours.Value), 9, MidpointRounding.AwayFromZero);

                this.currentEntity.ProductivityKGh = productivityKGh;

                this.tbxProductivityKGh.Text = this.currentEntity.ProductivityKGh_RoundString;
            }
            if (this.currentEntity.SumOfConsumption.HasValue && this.currentEntity.SumOfConsumption.Value != 0 &&
                this.currentEntity.SumOfProduction.HasValue)
            {
                scrapRate = Math.Round(((this.currentEntity.SumOfConsumption.Value - this.currentEntity.SumOfProduction.Value) / this.currentEntity.SumOfConsumption.Value), 9, MidpointRounding.AwayFromZero);

                this.currentEntity.ScrapRate = scrapRate;

                this.tbxScrapRate.Text = this.currentEntity.ScrapRate_RoundString;
            }

            this.ownerPage.CallContext = this.ownerPage.CostCalculationRef.ProductivityAndScrapDetailSave(new List <ProductivityAndScrapDetail>()
            {
                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 ProductivityAndScrapDetailList)
            {
                ((ProductivityAndScrapDetailList)this.ownerPage).LoadFilteredList();
            }
        }
示例#5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!this.ownerPage.CheckUserActionPermission(ETEMEnums.SecuritySettings.DiePriceListDetailsSave, false))
            {
                return;
            }


            if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value) || this.hdnRowMasterKey.Value == Constants.INVALID_ID_STRING)
            {
                this.currentEntity = new DiePriceListDetail();

                this.currentEntity.idDiePriceList = this.ddlVendor.SelectedValueINT;
            }
            else
            {
                this.currentEntity = this.ownerPage.CostCalculationRef.GetDiePriceListDetailById(this.hdnRowMasterKey.Value);

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

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

                    return;
                }
            }

            this.currentEntity.idNumberOfCavities  = this.ddlNumberOfCavities.SelectedValueINT;
            this.currentEntity.idProfileCategory   = this.ddlProfileCategory.SelectedValueINT;
            this.currentEntity.idProfileComplexity = this.ddlProfileComplexity.SelectedValueINT;
            this.currentEntity.DimensionA          = BaseHelper.ConvertToIntOrMinValue(this.tbxDimensionA.Text.Trim());
            this.currentEntity.DimensionB          = BaseHelper.ConvertToIntOrMinValue(this.tbxDimensionB.Text.Trim());
            this.currentEntity.Price    = BaseHelper.ConvertToDecimalOrMinValue(this.tbxDiePrice.Text.Trim());
            this.currentEntity.Lifespan = BaseHelper.ConvertToDecimalOrMinValue(this.tbxLifespan.Text.Trim());

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

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

                this.lbResultContext.Text = this.ownerPage.CallContext.Message;

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

            if (this.ownerPage is DiePriceListDetailsList)
            {
                ((DiePriceListDetailsList)this.ownerPage).LoadFilteredList();
            }
        }