foreach (DataRow drow in dtFilteredDeviceDefintion.Rows) { if (drow["Section"] == null || drow["Section"] == DBNull.Value) continue; string sectionName = Convert.ToString(drow["Section"]).ToLower().Trim(); switch (sectionName) { case "devicedefinition": if (drow["DeviceCommunication"] != null && drow["DeviceCommunication"] != DBNull.Value) deviceDefinitionType.DeviceCommunication = Convert.ToInt32(drow["DeviceCommunication"].ToString()); if (drow["UserAuthenticationType"] != null && drow["UserAuthenticationType"] != DBNull.Value) deviceDefinitionType.UserAuthentication = Convert.ToInt32(drow["UserAuthenticationType"]); deviceDefinitionType.ID = Convert.ToString(drow["DeviceDefinitionID"]); deviceDefinitionType.SoftwareVersion = Convert.ToString(drow["SoftwareVersion"]); deviceDefinitionType.DeviceType = Convert.ToString(drow["DeviceType"]); deviceDefinitionType.Model = Convert.ToString(drow["Model"]); deviceDefinitionType.Manufacturer = Convert.ToString(drow["Manufacturer"]); break; case "settings": SettingType st = new SettingType(); st.Name = Convert.ToString(drow["SettingName"]); st.Description = Convert.ToString(drow["SettingDescription"]); st.IsInitialDeviceSetting = Convert.ToString(drow["IsInitialDeviceSetting"]).ToLower() == "true" ? true : false; st.ReadOnlySpecified = true; st.ReadOnly = Convert.ToString(drow["IsReadOnly"]).ToLower() == "true" ? true : false; st.SettingDisplayText = Convert.ToString(drow["SettingLabel"]); st.ID = Convert.ToString(drow["DeviceDefinitionSettingID"]); st.CategoryID = Convert.ToString(drow["DeviceDefinitionCategoryID"]); if (drow["DisplayOrder"] != null && drow["DisplayOrder"] != DBNull.Value) { st.DisplayOrder = Convert.ToInt32(drow["DisplayOrder"]); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)