Exemplo n.º 1
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.GetSAPDataExpenseById(this.CurrentEntityMasterID);

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

                this.tbxDateFrom.SetTxbDateTimeValue(this.currentEntity.SAPData.DateFrom);
                this.tbxDateTo.SetTxbDateTimeValue(this.currentEntity.SAPData.DateTo);
                this.tbxStatus.Text = this.currentEntity.SAPData.Status;

                BaseHelper.CheckAndSetSelectedValue(this.ddlCostCenter.DropDownListCTRL, this.currentEntity.idCostCenter.ToString(), false);
                BaseHelper.CheckAndSetSelectedValue(this.ddlExpenseType.DropDownListCTRL, this.currentEntity.idExpensesType.ToString(), false);

                this.tbxValueData.Text = this.currentEntity.ValueDataRoundString;

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

            this.pnlFormData.Visible = true;
            this.pnlFormData.Focus();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new SAPDataExpense object.
 /// </summary>
 /// <param name="idSAPDataExpense">Initial value of the idSAPDataExpense property.</param>
 /// <param name="idSAPData">Initial value of the idSAPData property.</param>
 /// <param name="idCostCenter">Initial value of the idCostCenter property.</param>
 /// <param name="idExpensesType">Initial value of the idExpensesType property.</param>
 /// <param name="valueData">Initial value of the ValueData property.</param>
 public static SAPDataExpense CreateSAPDataExpense(global::System.Int32 idSAPDataExpense, global::System.Int32 idSAPData, global::System.Int32 idCostCenter, global::System.Int32 idExpensesType, global::System.Decimal valueData)
 {
     SAPDataExpense sAPDataExpense = new SAPDataExpense();
     sAPDataExpense.idSAPDataExpense = idSAPDataExpense;
     sAPDataExpense.idSAPData = idSAPData;
     sAPDataExpense.idCostCenter = idCostCenter;
     sAPDataExpense.idExpensesType = idExpensesType;
     sAPDataExpense.ValueData = valueData;
     return sAPDataExpense;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SAPDataExpenses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSAPDataExpenses(SAPDataExpense sAPDataExpense)
 {
     base.AddObject("SAPDataExpenses", sAPDataExpense);
 }
Exemplo n.º 4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!this.ownerPage.CheckUserActionPermission(ETEMEnums.SecuritySettings.SAPDataExpenseSave, false))
            {
                return;
            }

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

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

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

                    return;
                }

                
            }

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

            this.ownerPage.CallContext = this.ownerPage.CostCalculationRef.SAPDataExpenseSave(new List<SAPDataExpense>() { 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 SAPDataExpensesList)
            {
                ((SAPDataExpensesList)this.ownerPage).LoadFilteredList();
            }
        }