Ejemplo n.º 1
0
        public void MeterType_DEL_True()
        {
            //Arrange
            //Act
            var  deleteMeterType = _meterType.Delete(new SmartDB(), 1);
            bool flag            = deleteMeterType.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Ejemplo n.º 2
0
        private void ButtonDelete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(TextBoxDescription.Text) &&
                _currentUser.Role == "Administrator")
            {
                var deleteMeterType = _meterType.Delete(new SmartDB(), _meterTypeId);

                bool flag = deleteMeterType.Code == ErrorEnum.NoError;
                if (flag)
                {
                    MessageBox.Show("Meter Type Deleted");
                    ResetControls();
                    BindMeterTypeWithDataGrid();
                }
                else
                {
                    MessageBox.Show(deleteMeterType.Message);
                }
            }
            else
            {
                MessageBox.Show("No meter type to delete or Contact Admin.");
            }
        }