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_UPD_True()
        {
            //Arrange
            TMF.Reports.Model.City city = new TMF.Reports.Model.City()
            {
                Id          = "57b84d38ca424b109eaf7993e167babb",
                Description = "AL DAMMAM",
                EditedBy    = "646f18f9-6425-4769-aa79-16ecdb7cf816",
                DocDate     = DateTime.Now,
                Show        = 1,
                LockCount   = 0
            };

            //Act
            var  updateCity = _city.Update(new SmartDB(), city);
            bool flag       = updateCity.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }