示例#1
0
        public void MeterSize_DEL_True()
        {
            //Arrange
            //Act
            var  deleteMeterSize = _meterSize.Delete(new SmartDB(), 3);
            bool flag            = deleteMeterSize.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
示例#2
0
        private void ButtonDelete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(TextBoxDescription.Text) &&
                _currentUser.Role == "Administrator")
            {
                var deleteMeterSize = _meterSize.Delete(new SmartDB(), _meterSizeId);

                bool flag = deleteMeterSize.Code == ErrorEnum.NoError;
                if (flag)
                {
                    MessageBox.Show("Meter Size Deleted");
                    ResetControls();
                    BindMeterSizeWithDataGrid();
                }
                else
                {
                    MessageBox.Show(deleteMeterSize.Message);
                }
            }
            else
            {
                MessageBox.Show("No meter size to delete or Contact Admin.");
            }
        }