protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Organization organization = Organizations.GetOrganization(UserSession.LoginUser, UserSession.LoginUser.OrganizationID); if (organization.UseProductFamilies) { ProductFamilies productFamilies = new ProductFamilies(UserSession.LoginUser); productFamilies.LoadByOrganizationID(organization.OrganizationID); cmbProductFamily.Items.Add(new Telerik.Web.UI.RadComboBoxItem("<Without Product Line>", "-1")); foreach (ProductFamily productFamily in productFamilies) { cmbProductFamily.Items.Add(new Telerik.Web.UI.RadComboBoxItem(productFamily.Name, productFamily.ProductFamilyID.ToString())); } cmbProductFamily.Visible = true; } LoadGroupTypes(organization.OrganizationID); cmbDefaultGroup.SelectedValue = organization.DefaultPortalGroupID.ToString(); EmailTemplates templates = new EmailTemplates(UserSession.LoginUser); templates.LoadAll((UserSession.LoginUser.OrganizationID == 1078) && UserSession.CurrentUser.IsSystemAdmin, organization.ProductType); foreach (EmailTemplate template in templates) { cmbTemplate.Items.Add(new Telerik.Web.UI.RadComboBoxItem(template.Name, template.EmailTemplateID.ToString())); } LoadEAICombos(); } }
public static string GetProductFamily(RestCommand command, int productFamilyID) { ProductFamily productFamily = ProductFamilies.GetProductFamily(command.LoginUser, productFamilyID); if (productFamily.OrganizationID != command.Organization.OrganizationID) { throw new RestException(HttpStatusCode.Unauthorized); } return(productFamily.GetXml("ProductFamily", true)); }
public void LoadProductFamilies() { ProductFamilies productFamilies = new ProductFamilies(UserSession.LoginUser); productFamilies.LoadByOrganizationID(UserSession.LoginUser.OrganizationID); cmbProductFamilies.Items.Add(new RadComboBoxItem("Without Product Line", "-1")); foreach (ProductFamily productFamily in productFamilies) { cmbProductFamilies.Items.Add(new RadComboBoxItem(productFamily.Name, productFamily.ProductFamilyID.ToString())); } }
public static string GetProductFamilies(RestCommand command) { ProductFamilies productFamilies = new ProductFamilies(command.LoginUser); productFamilies.LoadByOrganizationID(command.Organization.OrganizationID); if (command.Format == RestFormat.XML) { return(productFamilies.GetXml("ProductFamilies", "ProductFamily", true, command.Filters)); } else { throw new RestException(HttpStatusCode.BadRequest, "Invalid data format"); } }
public void DeleteProductFamily(int productFamilyID) { if (!UserSession.CurrentUser.IsSystemAdmin) { return; } try { ProductFamilies.DeleteProductFamily(UserSession.LoginUser, productFamilyID); } catch (Exception ex) { DataUtils.LogException(UserSession.LoginUser, ex); } }
/// <summary> /// Returns Printer firmware version /// </summary> /// <param name="ipAddress">IP Address of the printer</param> /// <param name="productFamilies"><see cref=" ProductFamilies"/></param> /// <returns></returns> private string GetPrinterFirmwareVersion(IPAddress ipAddress, ProductFamilies productFamilies) { try { if (string.IsNullOrEmpty(_firmwareVersion)) { Printer.PrinterFamilies family = (Printer.PrinterFamilies)Enum.Parse(typeof(Printer.PrinterFamilies), Enum <ProductFamilies> .Value(productFamilies)); Printer.Printer printer = Printer.PrinterFactory.Create(family, ipAddress); _firmwareVersion = printer.FirmwareVersion; } } catch (Exception ex) { _firmwareVersion = "Not Available"; TraceFactory.Logger.Info("Unable to get Firmware version"); TraceFactory.Logger.Debug("Exception details: {0}".FormatWith(ex.JoinAllErrorMessages())); } return(_firmwareVersion); }
public static ImageComboBoxData[] GetTicketTypeProductFamilyComboData() { List <ImageComboBoxData> data = new List <ImageComboBoxData>(); ProductFamilies productFamilies = new ProductFamilies(UserSession.LoginUser); productFamilies.LoadByOrganizationID(UserSession.LoginUser.OrganizationID); ImageComboBoxData withoutProductFamily = new ImageComboBoxData(); withoutProductFamily.Text = "Without Product Line"; withoutProductFamily.Value = "-1"; data.Add(withoutProductFamily); foreach (ProductFamily productFamily in productFamilies) { ImageComboBoxData item = new ImageComboBoxData(); item.Text = productFamily.Name; item.Value = productFamily.ProductFamilyID.ToString(); data.Add(item); } return(data.ToArray()); }
/// <summary> /// Constructor of the form /// </summary> /// <param name="productFamilies">Product Family name</param> public ConfigurationParametersForm(ProductFamilies productFamilies) { _productFamilies = productFamilies; InitializeComponent(); }
/// <summary> /// Runs the test from the derived class which has the test number /// </summary> /// <param name="executionData">Plugin execution data</param> /// <param name="testNumber">test case number to be executed</param> /// <param name="ipAddress">IP Address of Printer</param> /// <param name="productFamily"><see cref=" ProductFamilies"/></param> public void RunTest(PluginExecutionData executionData, int testNumber, IPAddress ipAddress, ProductFamilies productFamily) { bool previousResult; _executedTests.TryGetValue(testNumber, out previousResult); // Run only if the test is failed in the previous run if (!previousResult) { TestDetailsAttribute testDetails = null; DateTime startTime = DateTime.Now; DateTime endTime = DateTime.Now; bool result = false; try { // extract the method from the current executing assembly and class MethodInfo info = GetTestMethod(testNumber, ref testDetails); if (null != info) { TraceFactory.Logger.Info(START_TAG + testNumber); _firmwareVersion = GetPrinterFirmwareVersion(ipAddress, productFamily); // get the start time startTime = DateTime.Now; UpdateStatus("Test {0} started".FormatWith(testNumber)); result = (bool)info.Invoke(this, null); UpdateStatus("Test {0} completed".FormatWith(testNumber)); // get the end time endTime = DateTime.Now; } } catch (Exception ex) { // Normally, we do not like catching all exceptions, but in this situation we don't know // what kind of exception will be thrown by the plug-ins. TraceFactory.Logger.Info("Test case thrown exception : " + testNumber); TraceFactory.Logger.Info("Error Information : " + ex.Message); TraceFactory.Logger.Debug(ex.InnerException?.StackTrace == null ? string.Empty : ex.InnerException.StackTrace); endTime = DateTime.Now; result = false; } finally { TraceFactory.Logger.Info(END_TAG + testNumber); TraceFactory.Logger.Debug("Test result: {0}".FormatWith(result ? "Passed" : "Failed")); // get log data from the log file. var logData = GetLogData(testNumber, executionData.SessionId); _executedTests.Remove(testNumber); _executedTests.Add(testNumber, result); // Tests for Wired and Wireless remain same for Print and IPconfiguratio plug-in; hence based on 'NetworkConnectivity' selection on plug-in, wired/ wireless mode is updated on the reports. // For other plug-in's where NetworkConnectivity is not set, wired/ wireless mode is taken from the 'TestDetailsAttribute' if (NetworkConnectivity == ConnectivityType.None) { // save the report after every test run, this will enable to the live report data SaveReport(executionData, testNumber, testDetails.Category, testDetails.Description, startTime, endTime, result, logData, testDetails.Protocol.ToString(), testDetails.Connectivity.ToString(), _firmwareVersion, testDetails.PrintProtocol.ToString()); } else { SaveReport(executionData, testNumber, testDetails.Category, testDetails.Description, startTime, endTime, result, logData, testDetails.Protocol.ToString(), NetworkConnectivity.ToString(), _firmwareVersion, testDetails.PrintProtocol.ToString()); } } } }
/// <summary> /// Runs the test from the derived class which has the test number /// </summary> /// <param name="executionData">Plugin execution data</param> /// <param name="testNumber">test case number to be executed</param> /// <param name="ipAddress">IP Address of Printer</param> /// <param name="productFamily"><see cref=" ProductFamilies"/></param> public void RunTest(PluginExecutionData executionData, string testNumber, IPAddress ipAddress, ProductFamilies productFamily) { int number; if (int.TryParse(testNumber, out number)) { RunTest(executionData, number, ipAddress, productFamily); } }
/// <summary> /// Loads the test case from the current assembly using the reflection /// Read the attributes like id, category, description. /// </summary> public bool LoadTestCases(Type type, Collection <int> selectedTests = null, PluginType plugin = PluginType.Default, Collection <PrintTestData> testDurationDetails = null) { if (!plugin.Equals(PluginType.Default)) { _pluginType = plugin; } _type = type; PrintTestData Testdata = null; selectAll_CheckBox.Checked = false; if (plugin == PluginType.Print) { // Hide and show the columns based on the plug-in type durationDataGridViewTextBoxColumn.Visible = true; connectivityDataGridViewTextBoxColumn.Visible = false; printProtocolDataGridViewTextBoxColumn.Visible = false; portNumberDataGridViewTextBoxColumn.Visible = false; testCaseDetails_DataGrid.ScrollBars = ScrollBars.Vertical; } if (plugin == PluginType.IPConfiguration) { connectivityDataGridViewTextBoxColumn.Visible = false; } if (null == type || null == productCategory_ComboBox.SelectedItem) { return(false); } ProductFamilies selectedCategory = (ProductFamilies)Enum.Parse(typeof(ProductFamilies), productCategory_ComboBox.SelectedItem.ToString()); // clear the previous rows before adding any new rows cTCTestCaseDetails.TestCaseDetails.Clear(); // walk thru all the methods inside the class and check if the method has TestDetails // then add to the data set. foreach (MethodInfo methodInfo in type.GetMethods()) { object[] attrs = methodInfo.GetCustomAttributes(new TestDetailsAttribute().GetType(), false); if (attrs.Length > 0) { // since we are having only the TestDetails type custom attributes so we can cast to this type TestDetailsAttribute details = (TestDetailsAttribute)attrs[0]; if (details.ProductCategory.HasFlag(selectedCategory)) { // create the row data CTCTestCaseDetailsDataSet.TestCaseDetailsRow row = cTCTestCaseDetails.TestCaseDetails.NewTestCaseDetailsRow(); row.IsSelected = selectedTests != null && selectedTests.Contains(details.Id); if (plugin.Equals(PluginType.Print) || _pluginType.Equals(PluginType.Print)) { bool durationAssigned = false; uint duration = 0; if (testDurationDetails != null && testDurationDetails.Count > 0) { var res = from data in testDurationDetails where data.TestId.Equals(details.Id) select new { Duration = data.Duration }; foreach (var item in res) { duration = Convert.ToUInt32(item.Duration); row.Duration = duration; durationAssigned = true; break; } } if (!durationAssigned) { row.Duration = details.PrintDuration; } if (details.PrintDuration > 0)//row.IsSelected && { Testdata = new PrintTestData(); Testdata.TestId = (int)details.Id; Testdata.Duration = (int)details.PrintDuration; _TestWithDuration.Add(Testdata); } row.PrintProtocol = details.PrintProtocol.ToString(); row.PortNumber = details.PortNumber; } row.Category = details.Category; row.ID = (uint)details.Id; row.Description = details.Description; row.Protocol = details.Protocol.ToString(); row.Connectivity = details.Connectivity.ToString(); cTCTestCaseDetails.TestCaseDetails.AddTestCaseDetailsRow(row); } } } return(true); }
private void LoadOrganization(int organizationID) { Organization organization = Organizations.GetOrganization(UserSession.LoginUser, UserSession.LoginUser.OrganizationID); if (organization.OrganizationID != UserSession.LoginUser.OrganizationID) { Response.Write("Invalid Request"); Response.End(); return; } textWebSite.Text = organization.Website; textDomains.Text = organization.CompanyDomains; textDescription.Text = organization.Description; cbDisableStatusNotifications.Checked = Settings.OrganizationDB.ReadBool("DisableStatusNotification", false); cbNewActionsVisible.Checked = organization.SetNewActionsVisibleToCustomers; cbUnsecureAttachments.Checked = organization.AllowUnsecureAttachmentViewing; cbSlaInitRespAnyAction.Checked = organization.SlaInitRespAnyAction; cbShowGroupMembersFirstInTicketAssignmentList.Checked = organization.ShowGroupMembersFirstInTicketAssignmentList; cbUpdateTicketChildrenGroupWithParent.Checked = organization.UpdateTicketChildrenGroupWithParent; cbHideDismissNonAdmins.Checked = organization.HideDismissNonAdmins; // cbCommunity.Checked = organization.UseForums; cbRequireCustomer.Checked = Settings.OrganizationDB.ReadBool("RequireNewTicketCustomer", false); //cbAdminCustomers.Checked = organization.AdminOnlyCustomers; cbTimeRequired.Checked = organization.TimedActionsRequired; cbAdminReports.Checked = organization.AdminOnlyReports; cmbUsers.SelectedValue = organization.PrimaryUserID.ToString(); cmbWikiArticle.SelectedValue = organization.DefaultWikiArticleID == null ? "" : organization.DefaultWikiArticleID.ToString(); if ((organization.ProductType == ProductType.Enterprise || organization.ProductType == ProductType.BugTracking)) { cbRequireProduct.Checked = organization.ProductRequired; cbRequireProductVersion.Checked = organization.ProductVersionRequired; cbUseProductFamilies.Checked = organization.UseProductFamilies; } else { cbRequireProduct.Visible = false; cbRequireProductVersion.Visible = false; cbUseProductFamilies.Visible = false; } cbIsCustomerInsightsActive.Checked = organization.IsCustomerInsightsActive; cbTwoStepVerification.Checked = organization.TwoStepVerificationEnabled; cbNoAttachmentsInOutboundEmail.Checked = organization.NoAttachmentsInOutboundEmail; lbNoAttachmentsInOutboundExcludeProductLine.Items.Clear(); ProductFamilies productFamilies = new ProductFamilies(UserSession.LoginUser); productFamilies.LoadByOrganizationID(organization.OrganizationID); List <string> excluded = new List <string>(); if (!string.IsNullOrEmpty(organization.NoAttachmentsInOutboundExcludeProductLine)) { excluded = organization.NoAttachmentsInOutboundExcludeProductLine.Split(',').ToList(); } foreach (ProductFamily productFamily in productFamilies) { lbNoAttachmentsInOutboundExcludeProductLine.Items.Add(new ListItem() { Value = productFamily.ProductFamilyID.ToString(), Text = productFamily.Name, Selected = excluded.Exists(p => p == productFamily.ProductFamilyID.ToString()) }); } if (!organization.NoAttachmentsInOutboundEmail || lbNoAttachmentsInOutboundExcludeProductLine.Items.Count == 0) { trProductLines.Style.Add("display", "none"); } cbUseWatson.Checked = organization.UseWatson; cbRequireTwoFactor.Checked = organization.RequireTwoFactor; cbRequireGroupAssignmentOnTickets.Checked = organization.RequireGroupAssignmentOnTickets; cbAlertContactNoEmail.Checked = organization.AlertContactNoEmail; cbDisableSupport.Checked = !organization.DisableSupportLogin; textPWExpire.Value = organization.DaysBeforePasswordExpire; if (string.IsNullOrEmpty(organization.TimeZoneID)) { cmbTimeZones.SelectedValue = "Central Standard Time"; } else { cmbTimeZones.SelectedValue = organization.TimeZoneID; } if (!string.IsNullOrEmpty(organization.CultureName)) { cmbDateFormat.SelectedValue = organization.CultureName; } cmbFontFamily.SelectedValue = Convert.ToInt32(organization.FontFamily).ToString(); cmbFontSize.SelectedValue = Convert.ToInt32(organization.FontSize).ToString(); cbLinkTicketCustomersWithProducts.Checked = Settings.OrganizationDB.ReadBool("ShowOnlyCustomerProducts", false); cbAutoAssignCustomerWithAssetOnTickets.Checked = organization.AutoAssignCustomerWithAssetOnTickets; cbAutoAssociateCustomerToTicketBasedOnAssetAssignment.Checked = organization.AutoAssociateCustomerToTicketBasedOnAssetAssignment; timeBDEnd.SelectedDate = organization.BusinessDayEnd; timeBDStart.SelectedDate = organization.BusinessDayStart; cbBDSunday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Sunday); cbBDMonday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Monday); cbBDTuesday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Tuesday); cbBDWednesday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Wednesday); cbBDThursday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Thursday); cbBDFriday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Friday); cbBDSaturday.Checked = organization.IsDayInBusinessHours(DayOfWeek.Saturday); if (organization.InternalSlaLevelID != null) { cmbSla.SelectedValue = organization.InternalSlaLevelID.ToString(); } }
private void LoadProperties(int organizationID) { lblProperties.Visible = true; Organizations organizations = new Organizations(UserSession.LoginUser); organizations.LoadByOrganizationID(organizationID); if (organizations.IsEmpty) { return; } Organization organization = organizations[0]; Users users = new Users(UserSession.LoginUser); string primaryUser = "******"; if (organization.PrimaryUserID != null) { users.LoadByUserID((int)organization.PrimaryUserID); primaryUser = users.IsEmpty ? "" : users[0].FirstLastName; } string defaultGroup = "[Unassigned]"; if (organization.DefaultPortalGroupID != null) { Group group = (Group)Groups.GetGroup(UserSession.LoginUser, (int)organization.DefaultPortalGroupID); if (group != null) { defaultGroup = group.Name; } } lblProperties.Visible = organizations.IsEmpty; DataTable table = new DataTable(); table.Columns.Add("Name"); table.Columns.Add("Value"); table.Rows.Add(new string[] { "Name:", organization.Name }); table.Rows.Add(new string[] { "Description:", organization.Description }); //table.Rows.Add(new string[] { "Portal Access:", organization.HasPortalAccess.ToString() }); /* * if (UserSession.CurrentUser.HasPortalRights) * { * string portalLink = "http://portal.ts.com?OrganizationID=" + organization.OrganizationID.ToString(); * portalLink = @"<a href=""" + portalLink + @""" target=""PortalLink"" onclick=""window.open('" + portalLink + @"', 'PortalLink')"">" + portalLink + "</a>"; * table.Rows.Add(new string[] { "Portal Link:", portalLink }); * table.Rows.Add(new string[] { "Default Portal Group:", defaultGroup }); * } */ table.Rows.Add(new string[] { "Organization ID:", organization.OrganizationID.ToString() }); table.Rows.Add(new string[] { "Primary Contact:", primaryUser }); //"Central Standard Time" TimeZoneInfo timeZoneInfo = null; try { timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(organization.TimeZoneID); } catch (Exception) { timeZoneInfo = null; } table.Rows.Add(new string[] { "Time Zone:", timeZoneInfo == null ? "Central Standard Time" : timeZoneInfo.DisplayName }); table.Rows.Add(new string[] { "Date Format:", (new CultureInfo(organization.CultureName)).DisplayName }); table.Rows.Add(new string[] { "Default Font Family:", organization.FontFamilyDescription }); table.Rows.Add(new string[] { "Default Font Size:", organization.FontSizeDescription }); table.Rows.Add(new string[] { "Business Days:", organization.BusinessDaysText == "" ? "[None Assigned]" : organization.BusinessDaysText }); table.Rows.Add(new string[] { "Business Day Start:", organization.BusinessDayStart == null ? "[None Assigned]" : ((DateTime)organization.BusinessDayStart).ToString("t", UserSession.LoginUser.CultureInfo) }); table.Rows.Add(new string[] { "Business Day End:", organization.BusinessDayEnd == null ? "[None Assigned]" : ((DateTime)organization.BusinessDayEnd).ToString("t", UserSession.LoginUser.CultureInfo) }); table.Rows.Add(new string[] { "Product Required on Ticket:", organization.ProductRequired.ToString() }); table.Rows.Add(new string[] { "Product Version Required on ticket:", organization.ProductVersionRequired.ToString() }); table.Rows.Add(new string[] { "Only show products for the customers of a ticket:", Settings.OrganizationDB.ReadBool("ShowOnlyCustomerProducts", false).ToString() }); table.Rows.Add(new string[] { "Auto Assign Customer with Asset On Tickets:", organization.AutoAssignCustomerWithAssetOnTickets.ToString() }); table.Rows.Add(new string[] { "Auto Associate Customer To Ticket based on Asset Assignment:", organization.AutoAssociateCustomerToTicketBasedOnAssetAssignment.ToString() }); table.Rows.Add(new string[] { "Require customer for new ticket:", Settings.OrganizationDB.ReadBool("RequireNewTicketCustomer", false).ToString() }); table.Rows.Add(new string[] { "Require time spent on timed actions:", organization.TimedActionsRequired.ToString() }); table.Rows.Add(new string[] { "Disable ticket status update emails:", Settings.OrganizationDB.ReadBool("DisableStatusNotification", false).ToString() }); table.Rows.Add(new string[] { "Visible to customers is initially enabled for new actions:", organization.SetNewActionsVisibleToCustomers.ToString() }); table.Rows.Add(new string[] { "Allow unauthenticated users to view attachments:", organization.AllowUnsecureAttachmentViewing.ToString() }); table.Rows.Add(new string[] { "Allow private actions to satisfy SLA first reponse:", organization.SlaInitRespAnyAction.ToString() }); table.Rows.Add(new string[] { "Chat ID:", organization.ChatID.ToString() }); /* string email = organization.SystemEmailID + "@teamsupport.com"; * table.Rows.Add(new string[] { "System Email:", "<a href=\"mailto:" + email + "\">" + email + "</a>" }); * table.Rows.Add(new string[] { "Organization Reply To Address:", organization.OrganizationReplyToAddress }); * table.Rows.Add(new string[] { "Require [New] keyword for emails:", organization.RequireNewKeyword.ToString() }); * table.Rows.Add(new string[] { "Require a known email address for emails:", organization.RequireKnownUserForNewEmail.ToString() }); */ //table.Rows.Add(new string[] { "Use Community:", organization.UseForums.ToString() }); WikiArticle defArticle = organization.DefaultWikiArticleID == null ? null : WikiArticles.GetWikiArticle(UserSession.LoginUser, (int)organization.DefaultWikiArticleID); table.Rows.Add(new string[] { "Default Wiki Article:", defArticle == null ? "[None Assigned]" : defArticle.ArticleName }); //table.Rows.Add(new string[] { "Only Admin Can Modify Customers:", organization.AdminOnlyCustomers.ToString() }); table.Rows.Add(new string[] { "Only Admin Can View Reports:", organization.AdminOnlyReports.ToString() }); SlaLevel level = organization.InternalSlaLevelID != null?SlaLevels.GetSlaLevel(UserSession.LoginUser, (int)organization.InternalSlaLevelID) : null; table.Rows.Add(new string[] { "Internal SLA:", level == null ? "[None Assigned]" : level.Name }); table.Rows.Add(new string[] { "Show Group Members First in Ticket Assignment List:", organization.ShowGroupMembersFirstInTicketAssignmentList.ToString() }); table.Rows.Add(new string[] { "Require Group Assignment On Tickets:", organization.RequireGroupAssignmentOnTickets.ToString() }); table.Rows.Add(new string[] { "Update Ticket Children Group With Parent:", organization.UpdateTicketChildrenGroupWithParent.ToString() }); table.Rows.Add(new string[] { "Hide Alert Dismiss for Non Admins:", organization.HideDismissNonAdmins.ToString() }); if ((organization.ProductType == ProductType.Enterprise || organization.ProductType == ProductType.BugTracking)) { table.Rows.Add(new string[] { "Use Product Lines:", organization.UseProductFamilies.ToString() }); } table.Rows.Add(new string[] { "Customer Insights:", organization.IsCustomerInsightsActive.ToString() }); table.Rows.Add(new string[] { "Two Factor Verification:", organization.TwoStepVerificationEnabled.ToString() }); table.Rows.Add(new string[] { "How many days before user passwords expire:", organization.DaysBeforePasswordExpire.ToString() }); table.Rows.Add(new string[] { "Do not include attachments on outbound emails:", organization.NoAttachmentsInOutboundEmail.ToString() }); if (organization.NoAttachmentsInOutboundEmail && !string.IsNullOrEmpty(organization.NoAttachmentsInOutboundExcludeProductLine)) { ProductFamilies productFamilies = new ProductFamilies(UserSession.LoginUser); try { productFamilies.LoadByIds(organization.NoAttachmentsInOutboundExcludeProductLine.Split(',').Select(int.Parse).ToList(), organization.OrganizationID); if (productFamilies.Count > 0) { table.Rows.Add(new string[] { "Except for the following Product Lines (include attachments):", string.Join(",", productFamilies.Select(p => p.Name).ToArray()) }); } } catch (Exception ex) { ExceptionLogs.LogException(UserSession.LoginUser, ex, "AdminCompany.aspx.cs.LoadProperties"); } } table.Rows.Add(new string[] { "Warn if contact has no email address:", organization.AlertContactNoEmail.ToString() }); table.Rows.Add(new string[] { "Allow TeamSupport to log into your account for technical support:", (!organization.DisableSupportLogin).ToString() }); table.Rows.Add(new string[] { "Use Watson:", organization.UseWatson.ToString() }); // table.Rows.Add(new string[] { "Require Two Factor Authentication:", organization.RequireTwoFactor.ToString() }); rptProperties.DataSource = table; rptProperties.DataBind(); }
public OperatingSystem() { IntPtr ptr; this.wProductName = "Unknown"; this.wProductBaseName = "Unknown"; this.wProductFamilyName = "Unknown"; this.wProductTypeName = "Unknown"; this.wProcessorArchitectureName = "Unknown"; this.wServicePackName = ""; OSVERSIONINFO structure = new OSVERSIONINFO(); structure.dwOSVersionInfoSize = (uint)Marshal.SizeOf(structure); SYSTEM_INFO lpSystemInfo = new SYSTEM_INFO(); GetVersionEx(ref structure); this.wPlatform = (PlatformID)structure.dwPlatformId; this.wMajor = (int)structure.dwMajorVersion; this.wMinor = (int)structure.dwMinorVersion; this.wBuild = (int)structure.dwBuildNumber; if (((this.wMajor == 5) && (this.wMinor >= 1)) || (this.wMajor > 5)) { GetNativeSystemInfo(ref lpSystemInfo); } else { GetSystemInfo(ref lpSystemInfo); } switch (this.wPlatform) { case PlatformID.Win32: if (this.wMajor == 4) { switch (this.wMinor) { case 10: switch (this.wBuild) { case 0x7ce: this.wProduct = Products.Windows98; this.wProductName = "Microsoft Windows 98"; break; case 0x8ae: this.wProduct = Products.Windows98SE; this.wProductName = "Microsoft Windows 98 Second Edition"; break; } break; case 90: this.wProduct = Products.WindowsME; this.wProductName = "Microsoft Windows Millennium Edition"; break; } } goto Label_0937; case PlatformID.WinNT: { ptr = LoadLibrary("shlwapi.dll"); IsOSInvoker delegateForFunctionPointer = (IsOSInvoker)Marshal.GetDelegateForFunctionPointer(GetProcAddress(ptr, 0x1b5), typeof(IsOSInvoker)); switch (this.wMajor) { case 5: switch (this.wMinor) { case 0: if (!delegateForFunctionPointer(11)) { if (delegateForFunctionPointer(10)) { this.wProduct = Products.Windows2000AdvancedServer; this.wProductName = "Microsoft Windows 2000 Advanced Server"; } else if (delegateForFunctionPointer(9)) { this.wProduct = Products.Windows2000Server; this.wProductName = "Microsoft Windows 2000 Server"; } else if (delegateForFunctionPointer(8)) { this.wProduct = Products.Windows2000Professional; this.wProductName = "Microsoft Windows 2000 Professional"; } break; } this.wProduct = Products.Windows2000DatacenterServer; this.wProductName = "Microsoft Windows 2000 Datacenter Server"; break; case 1: if (GetSystemMetrics(0x58) == 0) { if (delegateForFunctionPointer(0x23)) { this.wProduct = Products.WindowsXPMediaCenter; this.wProductName = "Microsoft Windows XP Media Center"; } else if (delegateForFunctionPointer(0x21)) { this.wProduct = Products.WindowsXPTabletPC; this.wProductName = "Microsoft Windows XP Tablet PC Edition"; } else if (delegateForFunctionPointer(0x13)) { this.wProduct = Products.WindowsXPHome; this.wProductName = "Microsoft Windows XP Home Edition"; } else if (delegateForFunctionPointer(8)) { this.wProduct = Products.WindowsXPProfessional; this.wProductName = "Microsoft Windows XP Professional"; } break; } this.wProduct = Products.WindowsXPStarter; this.wProductName = "Microsoft Windows XP Starter Edition"; break; case 2: if ((structure.wSuiteMask & 0x8000) != 0x8000) { if ((structure.wSuiteMask & 0x4000) == 0x4000) { this.wProduct = Products.WindowsComputeClusterServer2003; this.wProductName = "Microsoft Windows Compute Cluster Server 2003"; } else if ((structure.wSuiteMask & 0x2000) == 0x2000) { this.wProduct = Products.WindowsStorageServer2003; this.wProductName = "Microsoft Windows Storage Server 2003"; } else if (delegateForFunctionPointer(0x20)) { this.wProduct = Products.WindowsSmallBusinessServer2003; this.wProductName = "Microsoft Windows Small Business Server 2003"; } else if (GetSystemMetrics(0x59) != 0) { if (delegateForFunctionPointer(0x1f)) { this.wProduct = Products.WindowsServer2003R2Web; this.wProductName = "Microsoft Windows Server 2003 R2 Web Edition"; } else if (delegateForFunctionPointer(0x17)) { this.wProduct = Products.WindowsServer2003R2Datacenter; this.wProductName = "Microsoft Windows Server 2003 R2 Datacenter Edition"; } else if (delegateForFunctionPointer(0x16)) { this.wProduct = Products.WindowsServer2003R2Enterprise; this.wProductName = "Microsoft Windows Server 2003 R2 Enterprise Edition"; } else if (delegateForFunctionPointer(0x15)) { this.wProduct = Products.WindowsServer2003R2Standard; this.wProductName = "Microsoft Windows Server 2003 R2 Standard Edition"; } } else if (delegateForFunctionPointer(0x1f)) { this.wProduct = Products.WindowsServer2003Web; this.wProductName = "Microsoft Windows Server 2003 Web Edition"; } else if (delegateForFunctionPointer(0x17)) { this.wProduct = Products.WindowsServer2003Datacenter; this.wProductName = "Microsoft Windows Server 2003 Datacenter Edition"; } else if (delegateForFunctionPointer(0x16)) { this.wProduct = Products.WindowsServer2003Enterprise; this.wProductName = "Microsoft Windows Server 2003 Enterprise Edition"; } else if (delegateForFunctionPointer(0x15)) { this.wProduct = Products.WindowsServer2003Standard; this.wProductName = "Microsoft Windows Server 2003 Standard Edition"; } break; } this.wProduct = Products.WindowsHomeServer; this.wProductName = "Microsoft Windows Home Server"; break; } goto Label_0930; case 6: switch (structure.wProductType) { case 1: this.wProduct = Products.WindowsVistaUltimate; this.wProductName = "Microsoft Windows Vista Ultimate"; break; case 2: this.wProduct = Products.WindowsVistaHomeBasic; this.wProductName = "Microsoft Windows Vista Home Basic"; break; case 3: this.wProduct = Products.WindowsVistaHomePremium; this.wProductName = "Microsoft Windows Vista Home Premium"; break; case 4: this.wProduct = Products.WindowsVistaEnterprise; this.wProductName = "Microsoft Windows Vista Enterprise"; break; case 5: this.wProduct = Products.WindowsVistaHomeBasicN; this.wProductName = "Microsoft Windows Vista Home Basic N"; break; case 6: this.wProduct = Products.WindowsVistaBusiness; this.wProductName = "Microsoft Windows Vista Business"; break; case 7: this.wProduct = Products.WindowsServer2008Standard; this.wProductName = "Microsoft Windows Server 2008 Standard"; break; case 8: this.wProduct = Products.WindowsServer2008Datacenter; this.wProductName = "Microsoft Windows Server 2008 Datacenter"; break; case 9: this.wProduct = Products.WindowsSmallBusinessServer2008; this.wProductName = "Microsoft Windows Small Business Server 2008"; break; case 10: this.wProduct = Products.WindowsServer2008Enterprise; this.wProductName = "Microsoft Windows Server 2008 Enterprise"; break; case 11: this.wProduct = Products.WindowsVistaStarter; this.wProductName = "Microsoft Windows Vista Starter"; break; case 12: this.wProduct = Products.WindowsServer2008DatacenterCore; this.wProductName = "Microsoft Windows Server 2008 Datacenter Core"; break; case 13: this.wProduct = Products.WindowsServer2008StandardCore; this.wProductName = "Microsoft Windows Server 2008 Standard Core"; break; case 14: this.wProduct = Products.WindowsServer2008EnterpriseCore; this.wProductName = "Microsoft Windows Server 2008 Enterprise Core"; break; case 15: this.wProduct = Products.WindowsServer2008Enterprise; this.wProductName = "Microsoft Windows Server 2008 Enterprise"; break; case 0x10: this.wProduct = Products.WindowsVistaBusinessN; this.wProductName = "Microsoft Windows Vista Business N"; break; case 0x11: this.wProduct = Products.WindowsServer2008Web; this.wProductName = "Microsoft Windows Web Server 2008"; break; case 0x12: this.wProduct = Products.WindowsHPCServer2008; this.wProductName = "Microsoft Windows HPC Server 2008"; break; case 20: this.wProduct = Products.WindowsStorageServer2008Express; this.wProductName = "Microsoft Windows Storage Server 2008 Express"; break; case 0x15: this.wProduct = Products.WindowsStorageServer2008Standard; this.wProductName = "Microsoft Windows Storage Server 2008 Standard"; break; case 0x16: this.wProduct = Products.WindowsStorageServer2008Workgroup; this.wProductName = "Microsoft Windows Storage Server 2008 Workgroup"; break; case 0x17: this.wProduct = Products.WindowsStorageServer2008Enterprise; this.wProductName = "Microsoft Windows Storage Server 2008 Enterprise"; break; case 0x18: this.wProduct = Products.WindowsEssentialBusinessServer2008; this.wProductName = "Microsoft Windows Essential Business Server 2008"; break; case 0x1a: this.wProduct = Products.WindowsVistaHomePremiumN; this.wProductName = "Microsoft Windows Vista Home Premium N"; break; case 0x1b: this.wProduct = Products.WindowsVistaEnterpriseN; this.wProductName = "Microsoft Windows Vista Enterprise N"; break; case 0x1c: this.wProduct = Products.WindowsVistaUltimateN; this.wProductName = "Microsoft Windows Vista Ultimate N"; break; case 0x1d: this.wProduct = Products.WindowsServer2008WebCore; this.wProductName = "Microsoft Windows Web Server 2008 Core"; this.wProductTypeName = "Server"; break; case 30: this.wProduct = Products.WindowsEssentialBusinessServer2008; this.wProductName = "Microsoft Windows Essential Business Server 2008"; break; case 0x1f: this.wProduct = Products.WindowsEssentialBusinessServer2008; this.wProductName = "Microsoft Windows Essential Business Server 2008"; break; case 0x20: this.wProduct = Products.WindowsEssentialBusinessServer2008; this.wProductName = "Microsoft Windows Essential Business Server 2008"; break; case 0x23: this.wProduct = Products.WindowsEssentialBusinessServer2008WithoutHyperV; this.wProductName = "Microsoft Windows Essential Business Server 2008 Without Hyper-V"; break; case 0x24: this.wProduct = Products.WindowsServer2008StandardWithoutHyperV; this.wProductName = "Microsoft Windows Server 2008 Standard Without Hyper-V"; break; case 0x25: this.wProduct = Products.WindowsServer2008DatacenterWithoutHyperV; this.wProductName = "Microsoft Windows Server 2008 Datacenter Without Hyper-V"; break; case 0x26: this.wProduct = Products.WindowsServer2008EnterpriseWithoutHyperV; this.wProductName = "Microsoft Windows Server 2008 Enterprise Without Hyper-V"; break; case 0x27: this.wProduct = Products.WindowsServer2008DatacenterCoreWithoutHyperV; this.wProductName = "Microsoft Windows Server 2008 Datacenter Core Without Hyper-V"; break; case 40: this.wProduct = Products.WindowsServer2008StandardCoreWithoutHyperV; this.wProductName = "Microsoft Windows Server 2008 Standard Core Without Hyper-V"; break; case 0x29: this.wProduct = Products.WindowsServer2008EnterpriseCoreWithoutHyperV; this.wProductName = "Microsoft Windows Server 2008 Enterprise Core Without Hyper-V"; break; case 0x2a: this.wProduct = Products.HyperVServer2008; this.wProductName = "Microsoft Hyper-V Server 2008"; break; } goto Label_0930; } break; } default: goto Label_0937; } Label_0930: FreeLibrary(ptr); Label_0937: switch (this.wProduct) { case Products.Windows98: this.wProductBase = ProductBases.Windows98; this.wProductBaseName = "Microsoft Windows 98"; break; case Products.Windows98SE: this.wProductBase = ProductBases.Windows98SE; this.wProductBaseName = "Microsoft Windows 98 Second Edition"; break; case Products.WindowsME: this.wProductBase = ProductBases.WindowsME; this.wProductBaseName = "Microsoft Windows Millennium Edition"; break; case Products.Windows2000Professional: this.wProductBase = ProductBases.Windows2000Professional; this.wProductBaseName = "Microsoft Windows 2000 Professional"; break; case Products.Windows2000Server: this.wProductBase = ProductBases.Windows2000Server; this.wProductBaseName = "Microsoft Windows 2000 Server"; break; case Products.Windows2000AdvancedServer: this.wProductBase = ProductBases.Windows2000AdvancedServer; this.wProductBaseName = "Microsoft Windows 2000 Advanced Server"; break; case Products.Windows2000DatacenterServer: this.wProductBase = ProductBases.Windows2000DatacenterServer; this.wProductBaseName = "Microsoft Windows 2000 Datacenter Server"; break; case Products.WindowsXPStarter: this.wProductBase = ProductBases.WindowsXPStarter; this.wProductBaseName = "Microsoft Windows XP Starter Edition"; break; case Products.WindowsXPHome: this.wProductBase = ProductBases.WindowsXPHome; this.wProductBaseName = "Microsoft Windows XP Home Edition"; break; case Products.WindowsXPProfessional: this.wProductBase = ProductBases.WindowsXPProfessional; this.wProductBaseName = "Microsoft Windows XP Professional"; break; case Products.WindowsXPTabletPC: this.wProductBase = ProductBases.WindowsXPTabletPC; this.wProductBaseName = "Microsoft Windows XP Tablet PC Edition"; break; case Products.WindowsXPMediaCenter: this.wProductBase = ProductBases.WindowsXPMediaCenter; this.wProductBaseName = "Microsoft Windows XP Media Center"; break; case Products.WindowsServer2003Web: case Products.WindowsServer2003R2Web: this.wProductBase = ProductBases.WindowsServer2003Web; this.wProductBaseName = "Microsoft Windows Server 2003 Web Edition"; break; case Products.WindowsServer2003Standard: case Products.WindowsServer2003R2Standard: this.wProductBase = ProductBases.WindowsServer2003Standard; this.wProductBaseName = "Microsoft Windows Server 2003 Standard Edition"; break; case Products.WindowsServer2003Enterprise: case Products.WindowsServer2003R2Enterprise: this.wProductBase = ProductBases.WindowsServer2003Enterprise; this.wProductBaseName = "Microsoft Windows Server 2003 Enterprise Edition"; break; case Products.WindowsServer2003Datacenter: case Products.WindowsServer2003R2Datacenter: this.wProductBase = ProductBases.WindowsServer2003Datacenter; this.wProductBaseName = "Microsoft Windows Server 2003 Datacenter Edition"; break; case Products.WindowsComputeClusterServer2003: this.wProductBase = ProductBases.WindowsComputeClusterServer2003; this.wProductBaseName = "Microsoft Windows Compute Cluster Server 2003"; break; case Products.WindowsSmallBusinessServer2003: this.wProductBase = ProductBases.WindowsSmallBusinessServer2003; this.wProductBaseName = "Microsoft Windows Small Business Server 2003"; break; case Products.WindowsStorageServer2003: this.wProductBase = ProductBases.WindowsStorageServer2003; this.wProductBaseName = "Microsoft Windows Storage Server 2003"; break; case Products.WindowsHomeServer: this.wProductBase = ProductBases.WindowsHomeServer; this.wProductBaseName = "Microsoft Windows Home Server"; break; case Products.WindowsVistaStarter: this.wProductBase = ProductBases.WindowsVistaStarter; this.wProductBaseName = "Microsoft Windows Vista Starter"; break; case Products.WindowsVistaHomeBasic: case Products.WindowsVistaHomeBasicN: this.wProductBase = ProductBases.WindowsVistaHomeBasic; this.wProductBaseName = "Microsoft Windows Vista Home Basic"; break; case Products.WindowsVistaHomePremium: case Products.WindowsVistaHomePremiumN: this.wProductBase = ProductBases.WindowsVistaHomePremium; this.wProductBaseName = "Microsoft Windows Vista Home Premium"; break; case Products.WindowsVistaBusiness: case Products.WindowsVistaBusinessN: this.wProductBase = ProductBases.WindowsVistaBusiness; this.wProductBaseName = "Microsoft Windows Vista Business"; break; case Products.WindowsVistaEnterprise: case Products.WindowsVistaEnterpriseN: this.wProductBase = ProductBases.WindowsVistaEnterprise; this.wProductBaseName = "Microsoft Windows Vista Enterprise"; break; case Products.WindowsVistaUltimate: case Products.WindowsVistaUltimateN: this.wProductBase = ProductBases.WindowsVistaUltimate; this.wProductBaseName = "Microsoft Windows Vista Ultimate"; break; case Products.WindowsServer2008Web: case Products.WindowsServer2008WebCore: this.wProductBase = ProductBases.WindowsServer2008Web; this.wProductBaseName = "Microsoft Windows Web Server 2008"; break; case Products.WindowsServer2008Standard: case Products.WindowsServer2008StandardCore: case Products.WindowsServer2008StandardWithoutHyperV: case Products.WindowsServer2008StandardCoreWithoutHyperV: this.wProductBase = ProductBases.WindowsServer2008Standard; this.wProductBaseName = "Microsoft Windows Server 2008 Standard"; break; case Products.WindowsServer2008Enterprise: case Products.WindowsServer2008EnterpriseCore: case Products.WindowsServer2008EnterpriseWithoutHyperV: case Products.WindowsServer2008EnterpriseCoreWithoutHyperV: this.wProductBase = ProductBases.WindowsServer2008Enterprise; this.wProductBaseName = "Microsoft Windows Server 2008 Enterprise"; break; case Products.WindowsServer2008Datacenter: case Products.WindowsServer2008DatacenterCore: case Products.WindowsServer2008DatacenterWithoutHyperV: case Products.WindowsServer2008DatacenterCoreWithoutHyperV: this.wProductBase = ProductBases.WindowsServer2008Datacenter; this.wProductBaseName = "Microsoft Windows Server 2008 Datacenter"; break; case Products.WindowsHPCServer2008: this.wProductBase = ProductBases.WindowsServer2008Web; this.wProductBaseName = "Microsoft Windows HPC Server 2008"; break; case Products.WindowsSmallBusinessServer2008: this.wProductBase = ProductBases.WindowsSmallBusinessServer2008; this.wProductBaseName = "Microsoft Windows Small Business Server 2008"; break; case Products.WindowsEssentialBusinessServer2008: this.wProductBase = ProductBases.WindowsEssentialBusinessServer2008; this.wProductBaseName = "Microsoft Windows Essential Business Server 2008"; break; case Products.WindowsStorageServer2008Express: this.wProductBase = ProductBases.WindowsStorageServer2008Express; this.wProductBaseName = "Microsoft Windows Storage Server 2008 Express"; break; case Products.WindowsStorageServer2008Workgroup: this.wProductBase = ProductBases.WindowsStorageServer2008Workgroup; this.wProductBaseName = "Microsoft Windows Storage Server 2008 Workgroup"; break; case Products.WindowsStorageServer2008Standard: this.wProductBase = ProductBases.WindowsStorageServer2008Standard; this.wProductBaseName = "Microsoft Windows Storage Server 2008 Standard"; break; case Products.WindowsStorageServer2008Enterprise: this.wProductBase = ProductBases.WindowsStorageServer2008Enterprise; this.wProductBaseName = "Microsoft Windows Storage Server 2008 Enterprise"; break; case Products.HyperVServer2008: this.wProductBase = ProductBases.HyperVServer2008; this.wProductBaseName = "Microsoft Hyper-V Server 2008"; break; } switch (this.wProductBase) { case ProductBases.Windows98: case ProductBases.Windows98SE: this.wProductFamily = ProductFamilies.Windows98; this.wProductFamilyName = "Microsoft Windows 98"; break; case ProductBases.WindowsME: this.wProductFamily = ProductFamilies.WindowsME; this.wProductFamilyName = "Microsoft Windows Millennium Edition"; break; case ProductBases.Windows2000Professional: case ProductBases.Windows2000Server: case ProductBases.Windows2000AdvancedServer: case ProductBases.Windows2000DatacenterServer: this.wProductFamily = ProductFamilies.Windows2000; this.wProductFamilyName = "Microsoft Windows 2000"; break; case ProductBases.WindowsXPStarter: case ProductBases.WindowsXPHome: case ProductBases.WindowsXPProfessional: case ProductBases.WindowsXPTabletPC: case ProductBases.WindowsXPMediaCenter: this.wProductFamily = ProductFamilies.WindowsXP; this.wProductFamilyName = "Microsoft Windows XP"; break; case ProductBases.WindowsServer2003Web: case ProductBases.WindowsServer2003Standard: case ProductBases.WindowsServer2003Enterprise: case ProductBases.WindowsServer2003Datacenter: this.wProductFamily = ProductFamilies.WindowsServer2003; this.wProductFamilyName = "Microsoft Windows Server 2003"; break; case ProductBases.WindowsComputeClusterServer2003: this.wProductFamily = ProductFamilies.WindowsComputeClusterServer2003; this.wProductFamilyName = "Microsoft Windows Compute Cluster Server 2003"; break; case ProductBases.WindowsSmallBusinessServer2003: this.wProductFamily = ProductFamilies.WindowsSmallBusinessServer2003; this.wProductFamilyName = "Microsoft Windows Small Business Server 2003"; break; case ProductBases.WindowsStorageServer2003: this.wProductFamily = ProductFamilies.WindowsStorageServer2003; this.wProductFamilyName = "Microsoft Windows Storage Server 2003"; break; case ProductBases.WindowsHomeServer: this.wProductFamily = ProductFamilies.WindowsHomeServer; this.wProductFamilyName = "Microsoft Windows Home Server"; break; case ProductBases.WindowsVistaStarter: case ProductBases.WindowsVistaHomeBasic: case ProductBases.WindowsVistaHomePremium: case ProductBases.WindowsVistaBusiness: case ProductBases.WindowsVistaEnterprise: case ProductBases.WindowsVistaUltimate: this.wProductFamily = ProductFamilies.WindowsVista; this.wProductFamilyName = "Microsoft Windows Vista"; break; case ProductBases.WindowsServer2008Web: case ProductBases.WindowsServer2008Standard: case ProductBases.WindowsServer2008Enterprise: case ProductBases.WindowsServer2008Datacenter: this.wProductFamily = ProductFamilies.WindowsServer2008; this.wProductFamilyName = "Microsoft Windows Server 2008"; break; case ProductBases.WindowsHPCServer2008: this.wProductFamily = ProductFamilies.WindowsServer2008; this.wProductFamilyName = "Microsoft Windows Server 2008"; break; case ProductBases.WindowsSmallBusinessServer2008: this.wProductFamily = ProductFamilies.WindowsSmallBusinessServer2008; this.wProductFamilyName = "Microsoft Windows Small Business Server 2008"; break; case ProductBases.WindowsEssentialBusinessServer2008: this.wProductFamily = ProductFamilies.WindowsEssentialBusinessServer2008; this.wProductFamilyName = "Microsoft Windows Essential Business Server 2008"; break; case ProductBases.WindowsStorageServer2008Express: case ProductBases.WindowsStorageServer2008Workgroup: case ProductBases.WindowsStorageServer2008Standard: case ProductBases.WindowsStorageServer2008Enterprise: this.wProductFamily = ProductFamilies.WindowsStorageServer2008; this.wProductFamilyName = "Microsoft Windows Storage Server 2008"; break; case ProductBases.HyperVServer2008: this.wProductFamily = ProductFamilies.HyperVServer2008; this.wProductFamilyName = "Microsoft Hyper-V Server 2008"; break; } switch (this.wProductFamily) { case ProductFamilies.Windows98: case ProductFamilies.WindowsME: case ProductFamilies.WindowsXP: case ProductFamilies.WindowsVista: this.wProductType = ProductTypes.Workstation; this.wProductTypeName = "Workstation"; break; case ProductFamilies.Windows2000: case ProductFamilies.WindowsComputeClusterServer2003: case ProductFamilies.WindowsSmallBusinessServer2003: case ProductFamilies.WindowsStorageServer2003: case ProductFamilies.WindowsHomeServer: case ProductFamilies.WindowsServer2008: case ProductFamilies.WindowsHPCServer2008: case ProductFamilies.WindowsSmallBusinessServer2008: case ProductFamilies.WindowsEssentialBusinessServer2008: case ProductFamilies.WindowsStorageServer2008: this.wProductType = ProductTypes.Server; this.wProductTypeName = "Server"; break; } switch (lpSystemInfo.wProcessorArchitecture) { case 0: this.wProcessorArchitecture = ProcessorArchitectures.x86; break; case 6: this.wProcessorArchitecture = ProcessorArchitectures.ia64; break; case 9: this.wProcessorArchitecture = ProcessorArchitectures.x64; break; } switch (this.wProcessorArchitecture) { case ProcessorArchitectures.x86: this.wProcessorArchitectureName = "x86"; break; case ProcessorArchitectures.x64: this.wProcessorArchitectureName = "x64"; break; } if (structure.szCSDVersion.Length > 0) { this.wServicePackName = structure.szCSDVersion; } }