Beispiel #1
0
        private void DataGridViewDMZ_SelectionChanged(object sender, EventArgs e)
        {
            var        dmzId  = (int)DataGridViewDMZ.CurrentRow.Cells[0].Value;
            ReturnInfo getDMZ = _dmz.GetDMZById(new SmartDB(), dmzId);

            bool flag = getDMZ.Code == ErrorEnum.NoError;

            TMF.Reports.Model.DMZ dmz = (TMF.Reports.Model.DMZ)getDMZ.BizObject;

            try
            {
                ReturnInfo             getCity = _city.GetCityById(new SmartDB(), dmz.CityId.Trim());
                TMF.Reports.Model.City city    = (TMF.Reports.Model.City)getCity.BizObject;

                if (dmz.Id == 0 ? false : true)
                {
                    TextBoxDescription.Text = dmz.Description;
                    ComboBoxCity.Text       = city.Description;
                    TextBoxTotalMeters.Text = dmz.TotalNumberOfMeters.ToString();
                    _dmzId               = dmz.Id;
                    ButtonEdit.Enabled   = true;
                    ButtonDelete.Enabled = true;
                }
            }
            catch (Exception)
            {
                return;
            }
            LabelShow.Text = $"Showing {DataGridViewDMZ.CurrentRow.Index + 1} index of {_rowCount} records";
        }
Beispiel #2
0
        public void City_SearchById_True()
        {
            //Arrange
            //Act
            ReturnInfo getCity = _city.GetCityById(new SmartDB(), "1a29dac39ece4856ad2c59880b1cacce");
            bool       flag    = getCity.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Beispiel #3
0
        private void DataGridViewCity_SelectionChanged(object sender, EventArgs e)
        {
            var        cityId  = DataGridViewCity.CurrentRow.Cells[0].Value.ToString();
            ReturnInfo getCity = _city.GetCityById(new SmartDB(), cityId);

            bool flag = getCity.Code == ErrorEnum.NoError;

            City city = (City)getCity.BizObject;

            if (!string.IsNullOrEmpty(city.Id))
            {
                TextBoxDescription.Text = city.Description;
                TextBoxTotalMeters.Text = city.TotalNumberOfMeters.ToString();
                _cityId              = city.Id;
                ButtonEdit.Enabled   = true;
                ButtonDelete.Enabled = true;
            }
            LabelShow.Text = $"Showing {DataGridViewCity.CurrentRow.Index + 1} index of {_rowCount} records";
        }