Пример #1
0
        public void MeterSize_SearchByDescription_True()
        {
            //Arrange
            //Act
            ReturnInfo getMeterSize = _meterSize.GetMeterSizeByDescription(new SmartDB(), "");
            bool       flag         = getMeterSize.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Пример #2
0
        private void BindMeterSizeWithDataGrid()
        {   //TODO: Refactor this for reuse.
            try
            {
                ReturnInfo getMeterSizeList = _meterSize.GetMeterSizeByDescription(new SmartDB(), TextBoxSearch.Text);

                List <TMF.Reports.Model.MeterSize> meterSize = (List <TMF.Reports.Model.MeterSize>)getMeterSizeList.BizObject;
                var bindingList = new BindingList <TMF.Reports.Model.MeterSize>(meterSize);
                var source      = new BindingSource(bindingList, null);
                DataGridViewMeterSize.AutoGenerateColumns = false;
                DataGridViewMeterSize.DataSource          = source;
                LabelShow.Text = $"Showing {DataGridViewMeterSize.CurrentRow.Index + 1} index of {DataGridViewMeterSize.RowCount} records";
            }
            catch (Exception)
            {
                return;
            }
        }