/// <summary> /// Enables the controls. /// </summary> /// <param name="receiptActions">The receipt actions.</param> /// <param name="statusIndicator">if set to <c>true</c> [status indicator].</param> private void EnableControls(F15110ReceiptActionsData.GetReceiptActionRow receiptActions, bool statusIndicator) { this.receiptAction = receiptActions.ReceiptActionText; this.ReverseButtonPanel.Enabled = Convert.ToBoolean(receiptActions.IsButtonEnabled); if (statusIndicator == true) { this.ReverseReceiptButton.StatusOnText = this.receiptAction; } else { this.ReverseReceiptButton.StatusOffText = this.receiptAction; } this.ReverseReceiptButton.StatusIndicator = statusIndicator; this.ReverseReceiptButton.Enabled = Convert.ToBoolean(receiptActions.IsButtonEnabled); }
/// <summary> /// Displays the reverse link lable. /// </summary> /// <param name="receiptActions">The receipt actions.</param> private void DisplayReverseLinkLable(F15110ReceiptActionsData.GetReceiptActionRow receiptActions) { switch (receiptActions.ReceiptAction) { case 1: default: this.ReverseReceiptLabel.Text = string.Empty; this.ReverseReceiptLinkLabel.Text = string.Empty; this.ReverseReceiptLinkLabel.FormId = 0; break; case 2: this.ReverseReceiptLabel.Text = SharedFunctions.GetResourceString("ReversedBy"); this.ReverseReceiptLinkLabel.Text = receiptActions.ReverseReceiptLink; this.ReverseReceiptLinkLabel.FormId = receiptActions.ReverseReceiptLinkID; break; case 3: this.ReverseReceiptLabel.Text = SharedFunctions.GetResourceString("ReversalOf"); this.ReverseReceiptLinkLabel.Text = receiptActions.ReverseReceiptLink; this.ReverseReceiptLinkLabel.FormId = receiptActions.ReverseReceiptLinkID; break; } }
/// <summary> /// Gets the receipt button actions and assign the color according to the revesal type /// </summary> private void GetReceiptActions() { this.receiptActionsData = this.form15110Control.WorkItem.F15110_GetReceiptActions(this.receiptId); this.reverseDatatableCount = this.receiptActionsData.GetReceiptAction.Rows.Count; if (this.reverseDatatableCount > 0) { receiptActions = (F15110ReceiptActionsData.GetReceiptActionRow) this.receiptActionsData.GetReceiptAction.Rows[0]; this.DisplayReverseLinkLable(receiptActions); if (!string.IsNullOrEmpty(receiptActions.AddInterestAction.ToString())) { if (receiptActions.AddInterestAction.Equals(1)) { this.AddIntrestPaidButton.BackColor = Color.FromArgb(28, 81, 128); } else if (receiptActions.AddInterestAction.Equals(2)) { this.AddIntrestPaidButton.BackColor = Color.FromArgb(128, 0, 0); } else if (receiptActions.AddInterestAction.Equals(3)) { this.AddIntrestPaidButton.BackColor = Color.FromArgb(152, 152, 152); } } if (receiptActions.ReceiptAction == (int)ReceiptActionTypes.ReverseReceipt) { this.EnableControls(receiptActions, true); } else if (receiptActions.ReceiptAction == (int)ReceiptActionTypes.ReversedReceipt) { this.EnableControls(receiptActions, false); } else if (receiptActions.ReceiptAction == (int)ReceiptActionTypes.ReversalReceipt) { this.EnableControls(receiptActions, false); } if (receiptActions.IsAddInterestButtonEnabled.Equals(1)) { this.AddIntrestPaidButton.Enabled = true; } else { this.AddIntrestPaidButton.Enabled = false; this.AddIntrestPaidButton.ForeColor = Color.LightGray; } if (receiptActions.IsManagePaymentButtonEnabled.Equals(1)) { this.btnManagePayment.Enabled = true; this.btnManagePayment.ForeColor = Color.White; this.btnManagePayment.BackColor = Color.FromArgb(28, 81, 128); } else { this.btnManagePayment.Enabled = false; this.btnManagePayment.ForeColor = Color.LightGray; this.btnManagePayment.BackColor = Color.FromArgb(152, 152, 152); } if (!string.IsNullOrEmpty(receiptActions.AddInterestText.ToString())) { this.AddIntrestPaidButton.Text = receiptActions.AddInterestText.ToString(); } } else { this.ReverseReceiptButton.StatusOnText = this.receiptAction; this.ReverseReceiptButton.StatusIndicator = true; this.ReverseReceiptLabel.Text = string.Empty; this.ReverseReceiptLinkLabel.Text = string.Empty; this.ReverseReceiptLinkLabel.FormId = 0; this.ReverseButtonPanel.Enabled = false; this.ReverseReceiptButton.Enabled = false; this.AddIntrestPaidButton.Enabled = false; this.btnManagePayment.Enabled = false; } }