public static BaseModelNumberModel ToBaseModelNumber(this ModelNumber modelNumber) { BaseModelNumberModel _result = new BaseModelNumberModel(); _result.Id = modelNumber.Id; _result.ModelNo = modelNumber.ModelNo; _result.Narration = modelNumber.Narration; _result.CreatedDate = modelNumber.CreatedDate; _result.ModifiedDate = modelNumber.ModifiedDate; return(_result); }
public override int GetHashCode() { // Generated by IntelliJ int result = Manufacturer.GetHashCode(); result = 31 * result + ModelNumber.GetHashCode(); result = 31 * result + SerialNumber.GetHashCode(); result = 31 * result + FirmwareRevision.GetHashCode(); result = 31 * result + HardwareRevision.GetHashCode(); return(result); }
public IHttpActionResult PostNumber(DataTest datanumber, ModelNumber datanumbermodel) { var DataNumber = new DataTest() { number = datanumber.number, NameNumber = datanumber.NameNumber }; var DataNumberModel = new ModelNumber() { }; return(Ok(DataNumber)); }
private void ShowInformation() { GameManager.Instance.ui.SetInformationPanelTowers(new string[] { transform.name, ModelNumber.ToString(), "N/a", Energy.ToString(), Speed.ToString(), UpgradeCost.ToString(), Name }); }
// Unknown 01/01/01 /// <summary> /// Function operates on a given id string to decode information /// </summary> /// <param name="idString">Assumes valid Id string from an AWG</param> private void GetAwgInformation(string idString) { if (string.IsNullOrEmpty(idString)) { Assert.Fail("No ID string returned from AWG " + LogicalAWGNumber); } //This is kind of cute, C# allows us to label the regex group we want with a name, instead of having to use an array index value. //Regex AwgFeatureMatcher = new Regex(@"TEKTRONIX,(?<type>AWG|HSG)(?<modelNumber>\d+)(?<class>.),(?<serial>.+),SCPI:(?<scpi>.+) FW:(?<fwVersion>.+)"); //To get the 70k to work it doesn't appear to add a SCPI field to its ID string var awgFeatureMatcher = new Regex(@"TEKTRONIX,(?<type>AWG|HSG)(?<modelNumber>\d+)(?<class>.*),(?<serial>.*),FV:(?<AppVersion>.+)"); Match match = awgFeatureMatcher.Match(idString.Trim()); //The ID Assert.IsTrue(match.Success, "The AWG ID string did not match the specified pattern. The actual value returned was: " + idString); // make sure you got a good match //Remember that since we have an instance of the AWG accessors for each one in the setup, these values are specific to that AWG ModelNumber = match.Groups["modelNumber"].Value; ClassLetter = match.Groups["class"].Value; FamilyType = match.Groups["type"].Value; SerialNumber = match.Groups["serial"].Value; AppVersion = match.Groups["AppVersion"].Value; ModelString = FamilyType + ModelNumber + ClassLetter; var awgAppVersionMatcher = new Regex(@"(?<Major>\d+).(?<Minor>\d+).(?<Version>\d+)"); Match versionMatch = awgAppVersionMatcher.Match(AppVersion); Assert.IsTrue(versionMatch.Success, "Unexpected version format" + AppVersion); AppVersionMajor = versionMatch.Groups["Major"].Value; AppVersionMinor = versionMatch.Groups["Minor"].Value; AppVersionVersion = versionMatch.Groups["Version"].Value; if (ModelNumber.Length == 5) { if (ModelNumber.Contains("70")) { Family = "70"; // aka Pascal } else if (ModelNumber.Contains("50")) { Family = "50"; // aka Bode } else { Family = "Unknown"; } } }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ModelNumber != null ? ModelNumber.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Sku != null ? Sku.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Price.GetHashCode(); hashCode = (hashCode * 397) ^ NewPrice.GetHashCode(); return(hashCode); } }
public static ModelNumber ToModelNumber(this BaseModelNumberModel modelNumber) { ModelNumber _result = new ModelNumber(); if (modelNumber.Id.HasValue) { _result.Id = modelNumber.Id.GetValueOrDefault(); } _result.ModelNo = modelNumber.ModelNo; _result.Narration = modelNumber.Narration; _result.CreatedDate = modelNumber.CreatedDate; _result.ModifiedDate = modelNumber.ModifiedDate; return(_result); }
public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null || GetType() != obj.GetType()) { return(false); } var that = obj as DeviceInformation; return(Manufacturer.Equals(that.Manufacturer) && ModelNumber.Equals(that.ModelNumber) && SerialNumber.Equals(that.SerialNumber) && FirmwareRevision.Equals(that.FirmwareRevision) && HardwareRevision.Equals(that.HardwareRevision)); }
void CheckForErrors(ref string errorInfo, string propertyName) { switch (propertyName) { case "ModelNumber": if (ModelNumber != null && ModelNumber.Contains("XXX")) { errorInfo = "ModelName can not contain adult content!"; } break; case "ModelName": if (ModelName == null) { errorInfo = "Can't be null"; } else if (ModelName != null && ModelName.Contains("XXX")) { errorInfo = "ModelName can not contain adult content!"; } break; case "UnitCost": if (UnitCost < 0) { errorInfo = "Unit Cost can not be negative"; } break; case "Description": if (Description != null && Description.Contains("XXX")) { errorInfo = "Description can not contain adult content!"; } break; case "UnitsInStock": if (UnitsInStock < 0) { errorInfo = "Stock count can not be negative!"; } break; } }
public override string ToString() { //System.Windows.Forms.MessageBox.Show(string.Format("{0} ({1})", ModelName, ModelNumber)); return(string.Format("{0} {1}", ModelName.Trim(), ModelNumber.Trim())); }
public ViewModelNumber() { // model init this.__dataModel = new ModelNumber(); }