private void ShowDetailsManual(AAnalysisTypeRow ARow)
 {
     if (ARow == null)
     {
         pnlDetails.Enabled = false;
         ucoValues.Enabled  = false;
     }
     else
     {
         pnlDetails.Enabled = true;
         ucoValues.Enabled  = true;
         ucoValues.TypeCode = ARow.AnalysisTypeCode;
         txtDetailAnalysisTypeCode.Enabled = ucoValues.Count == 0;
     }
 }
        private void NewRowManual(ref AAnalysisTypeRow ARow)
        {
            string newName = Catalog.GetString("NEWTYPE");
            Int32 countNewDetail = 0;

            if (FMainDS.AAnalysisType.Rows.Find(new object[] { newName }) != null)
            {
                while (FMainDS.AAnalysisType.Rows.Find(new object[] { newName + countNewDetail.ToString() }) != null)
                {
                    countNewDetail++;
                }

                newName += countNewDetail.ToString();
            }

            ARow.AnalysisTypeCode = newName;
        }
Exemple #3
0
        private void NewRowManual(ref AAnalysisTypeRow ARow)
        {
            string newName        = Catalog.GetString("NEWTYPE");
            Int32  countNewDetail = 0;

            if (FMainDS.AAnalysisType.Rows.Find(new object[] { newName }) != null)
            {
                while (FMainDS.AAnalysisType.Rows.Find(new object[] { newName + countNewDetail.ToString() }) != null)
                {
                    countNewDetail++;
                }

                newName += countNewDetail.ToString();
            }

            ARow.AnalysisTypeCode = newName;
        }
Exemple #4
0
        private void ShowDetailsManual(ARecurringTransAnalAttribRow ARow)
        {
            cmbDetailAnalysisAttributeValue.Items.Clear();

            if (ARow == null)
            {
                return;
            }

            // The content of the combobox derives from the typecode, the ledgernumber and whether the value is active.

            foreach (AFreeformAnalysisRow AFRow in  FCacheDS.AFreeformAnalysis.Rows)
            {
                if (ARow.AnalysisTypeCode.Equals(AFRow.AnalysisTypeCode) && ARow.LedgerNumber.Equals(AFRow.LedgerNumber))
                {
                    // add value if it is active but also if not active and already set
                    if (AFRow.Active || (ARow.AnalysisAttributeValue == AFRow.AnalysisValue))
                    {
                        cmbDetailAnalysisAttributeValue.Items.Add(AFRow.AnalysisValue);
                    }
                }
            }

            txtReadonlyAnalysisTypeCode.Text = ARow.AnalysisTypeCode;
            AAnalysisTypeRow analysisTypeRow = (AAnalysisTypeRow)FCacheDS.AAnalysisType.Rows.Find(new Object[] { ARow.AnalysisTypeCode });

            txtReadonlyDescription.Text = analysisTypeRow.AnalysisTypeDescription;

            if ((ARow.AnalysisAttributeValue != null) && (ARow.AnalysisAttributeValue.Length > 0))
            {
                cmbDetailAnalysisAttributeValue.SetSelectedString(ARow.AnalysisAttributeValue);
            }
            else
            {
                cmbDetailAnalysisAttributeValue.SetSelectedString("", -1);
            }

            // If the batch has been posted, the Combobox can't be changed.
            Boolean changeable = GetBatchRow() != null &&
                                 (GetBatchRow().BatchStatus == MFinanceConstants.BATCH_UNPOSTED);

            cmbDetailAnalysisAttributeValue.Enabled = changeable;
        }
        /// <summary>
        /// Performs checks to determine whether a deletion of the current row is permissable
        /// </summary>
        /// <param name="ARowToDelete">the currently selected row to be deleted</param>
        /// <param name="ADeletionQuestion">can be changed to a context-sensitive deletion confirmation question</param>
        /// <returns>true if user is permitted and able to delete the current row</returns>
        private bool PreDeleteManual(AAnalysisTypeRow ARowToDelete, ref string ADeletionQuestion)
        {
            /*Code to execute before the delete can take place*/
            DataView DependentRecordsDV = new DataView(FMainDS.AFreeformAnalysis);

            DependentRecordsDV.RowStateFilter = DataViewRowState.CurrentRows;
            DependentRecordsDV.RowFilter      = String.Format("{0} = '{1}'",
                                                              AFreeformAnalysisTable.GetAnalysisTypeCodeDBName(),
                                                              ARowToDelete.AnalysisTypeCode);

            if (DependentRecordsDV.Count > 0)
            {
                // Tell the user that we cannot allow deletion if any rows exist in the DataView
                TMessages.MsgRecordCannotBeDeletedDueToDependantRecordsError(
                    "Analysis Type", "an Analysis Type", "Analysis Types", "Analysis Value", "an Analysis Value",
                    "Analysis Values", ARowToDelete.AnalysisTypeCode, DependentRecordsDV.Count);

                return(false);
            }

            return(true);
        }
 private void ShowDetailsManual(AAnalysisTypeRow ARow)
 {
     if (ARow == null)
     {
         pnlDetails.Enabled = false;
         ucoValues.Enabled = false;
     }
     else
     {
         pnlDetails.Enabled = true;
         ucoValues.Enabled = true;
         ucoValues.TypeCode = ARow.AnalysisTypeCode;
         txtDetailAnalysisTypeCode.Enabled = ucoValues.Count == 0;
     }
 }
 private void GetDetailDataFromControlsManual(AAnalysisTypeRow ARow)
 {
     ucoValues.GetDataFromControls();
 }
        /// <summary>
        /// Performs checks to determine whether a deletion of the current row is permissable
        /// </summary>
        /// <param name="ARowToDelete">the currently selected row to be deleted</param>
        /// <param name="ADeletionQuestion">can be changed to a context-sensitive deletion confirmation question</param>
        /// <returns>true if user is permitted and able to delete the current row</returns>
        private bool PreDeleteManual(AAnalysisTypeRow ARowToDelete, ref string ADeletionQuestion)
        {
            /*Code to execute before the delete can take place*/
            DataView DependentRecordsDV = new DataView(FMainDS.AFreeformAnalysis);

            DependentRecordsDV.RowStateFilter = DataViewRowState.CurrentRows;
            DependentRecordsDV.RowFilter = String.Format("{0} = '{1}'",
                AFreeformAnalysisTable.GetAnalysisTypeCodeDBName(),
                ARowToDelete.AnalysisTypeCode);

            if (DependentRecordsDV.Count > 0)
            {
                // Tell the user that we cannot allow deletion if any rows exist in the DataView
                TMessages.MsgRecordCannotBeDeletedDueToDependantRecordsError(
                    "Analysis Type", "an Analysis Type", "Analysis Types", "Analysis Value", "an Analysis Value",
                    "Analysis Values", ARowToDelete.AnalysisTypeCode, DependentRecordsDV.Count);

                return false;
            }

            return true;
        }
 private void GetDetailDataFromControlsManual(AAnalysisTypeRow ARow)
 {
     ucoValues.GetDataFromControls();
 }