/// <summary>
        /// Method Name     : IsValidAllData
        /// Author          : Hiren Patel
        /// Creation Date   : 1 Mar 2018
        /// Purpose         : To validate all data before save
        /// Revision        :
        /// </summary>
        /// <returns>validate message</returns>
        private string IsValidAllData()
        {
            string message = estimateValidateServices.ValidateServiceDates(txtPackDate.Text, txtLoadDate.Text, txtMoveDate.Text);

            if (String.IsNullOrEmpty(message))
            {
                message = estimateValidateServices.ValidateCustomerAddress(txtOriginAddress.Text, txtDestinationAddress.Text);
            }
            if (String.IsNullOrEmpty(message))
            {
                message = estimateValidateServices.ValidateWhatMattersMost(txtWhatMattersMost.Text);
            }
            if (String.IsNullOrEmpty(message))
            {
                message = estimateValidateServices.ValidateValuationData(txtDeclaredValue.Text, txtCoverageValue.Text, txtCost.Text);
            }
            return(message);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Event Name      : BtnUpdatesNeed_TouchUpInside
        /// Author          : Hiren Patel
        /// Creation Date   : 29 Dec 2017
        /// Purpose         : To update and change entered services dates
        /// Revision        : By [Ranjana Singh] 08 Feb 2018
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">Event Argument</param>
        private void BtnUpdatesNeed_TouchUpInside(object sender, EventArgs e)
        {
            if (!txtCoverageValue.UserInteractionEnabled)//- Removed condition as per Sonar bug.
            {
                ResetControlEditMode();
            }
            else
            {
                string message = estimateValidateServices.ValidateValuationData(txtDeclaredValue.Text, txtCoverageValue.Text, txtCost.Text);
                if (string.IsNullOrEmpty(message))
                {
                    txtDeclaredValue.Text = UtilityPCL.CurrencyFormat(txtDeclaredValue.Text);
                    txtCost.Text          = UtilityPCL.CurrencyFormat(txtCost.Text);

                    SaveDataToDTO();
                    ResetControlReadOnlyMode();
                }
                else
                {
                    UIHelper.ShowMessage(message);
                }
            }
        }