private bool DataIsValid()
        {
            //if (string.IsNullOrEmpty(txtCode.Text))
            //{
            //    My.Message.ShowValidationError(txtCode, "Code must not be blank");
            //    return false;
            //}

            //if (string.IsNullOrEmpty(txtDescription.Text))
            //{
            //    My.Message.ShowValidationError(txtDescription, "Description must not be blank");
            //    return false;
            //}

            //if (CallerForm.ContainsData(dtEffectivityDate.Value, ItemData.RowId))
            //{
            //    MessageDialog.ShowValidationError(dtEffectivityDate, "Duplicate Record!");
            //    return false;
            //}

            var reader    = new SalaryScheduleDataReader();
            var foundItem = reader.GetItemWithEffectivity(dtEffectivityDate.Value);

            if (foundItem != null && foundItem.Id != ItemData.Id)
            {
                MessageDialog.ShowValidationError(dtEffectivityDate, "Duplicate Effectivity Date");
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public void GetSalaryOfPositionIdTest()
        {
            var reader = new SalaryScheduleDataReader();

            var result = reader.GetSalaryOfPositionId(54, 1, DateTime.Today);

            Assert.AreEqual <Decimal>((decimal)25290.00, result);
        }
        private void ShowBasicSalary()
        {
            if (cboStep.SelectedIndex == -1)
            {
                return;
            }

            var reader = new SalaryScheduleDataReader();

            var position = (PositionSalaryGrade)cboPosition.SelectedItem;

            lblSalary.Text = reader.GetSalaryOfPositionId(position.PositionId, cboStep.SelectedIndex + 1, DateTime.Today).ToString("P#,###.00");
        }