public IEnumerator callContract(ContractName contractName, object arg0, object arg1) { var address = ConvertHexStringToByteArray("cf2cc8dcffc74cfe0a079fdbb16c0d6f78290527bfbcef935553d50746ecc00f"); switch (contractName) { case ContractName.Win: var winReq = new WinRequest(address); yield return(winReq.Win((byte[])arg0, (string)arg1)); printProcessResult(winReq); //log break; case ContractName.Rent: var rentReq = new RentRequest(address); yield return(rentReq.Rent((string)arg0, (int)arg1)); printProcessResult(rentReq); break; case ContractName.CreatePatent: var patentReq = new NewVirusRequest(address); yield return(patentReq.NewVirus((string)arg0, (int)arg1)); printProcessResult(patentReq); break; } }
public override int GetHashCode() { unchecked { var hashCode = ContractID; hashCode = (hashCode * 397) ^ (ContractName != null ? ContractName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CustomerID; hashCode = (hashCode * 397) ^ (CustomerName != null ? CustomerName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ContractType != null ? ContractType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Active.GetHashCode(); hashCode = (hashCode * 397) ^ Default.GetHashCode(); hashCode = (hashCode * 397) ^ Taxable.GetHashCode(); hashCode = (hashCode * 397) ^ StartDate.GetHashCode(); hashCode = (hashCode * 397) ^ EndDate.GetHashCode(); hashCode = (hashCode * 397) ^ (RetainerFlatFeeContract != null ? RetainerFlatFeeContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (HourlyContract != null ? HourlyContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (BlockHoursContract != null ? BlockHoursContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (BlockMoneyContract != null ? BlockMoneyContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (RemoteMonitoringContract != null ? RemoteMonitoringContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (OnlineBackupContract != null ? OnlineBackupContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ProjectOneTimeFeeContract != null ? ProjectOneTimeFeeContract.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ProjectHourlyRateContract != null ? ProjectHourlyRateContract.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// 固定合同名称列表 /// </summary> /// <param name="q"></param> /// <param name="page"></param> /// <returns></returns> public ActionResult ContractNameList(string q, string page) { string[] list = new string[] { "Advertisement Service Agreement", "Amendment", "Car Rental Service Agreement", "Construction Agreement", "Co-packing Agreement", "Creative Design Service Agreement", "Customs Service Contract", "Distribution Agreement", "Event Service Agreement", "Framework Agreement on Packaging Materials Procurement", "Framework Agreement on Raw Materials Procurement", "General Terms & Conditions for Seafreight", "Goods Purchase Agreement", "House Lease Agreement", "Market Research Service Agreement", "Merchandise Agreement", "Office Lease Agreement", "Packaging Design Service Agreement", "Recruitment Service Agreement", "Service Agreement", "Software Development Agreement", "Sub-Distribution Agreement", "Supplementary Agreement", "System Maintenance Agreement", "Transportation by Road Agreement", "Warehousing & Distribution Service Agreement", "Warehousing Service Agreement", "Waste Disposal Service Agreement" }; List <string> contractNameList = new List <string>(); contractNameList.AddRange(list); var lstRes = new List <ContractName>(); for (var i = 0; i < contractNameList.Count; i++) { var cName = new ContractName(); cName.id = contractNameList[i].ToString(); cName.name = contractNameList[i].ToString(); lstRes.Add(cName); } if (q != null && q.Trim().Length > 0) { lstRes = (from r in lstRes where r.name.Contains(q) select r).ToList(); } var lstCurPageRes = string.IsNullOrEmpty(page) ? lstRes.Take(10) : lstRes.Skip(Convert.ToInt32(page) * 10 - 10).Take(10); return(Json(new { items = lstCurPageRes, total_count = lstRes.Count }, JsonRequestBehavior.AllowGet)); }
//ignores ID public bool WeakCompare(Contract other) { if (!ContractName.Equals(other.ContractName)) { return(false); } if (!ContractNumber.Equals(other.ContractNumber)) { return(false); } if (!LastUsedDirectory.Equals(other.LastUsedDirectory)) { return(false); } return(true); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { // As obtained from the Jon Skeet answer to: // http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode // And adapted towards the Modified Bernstein (shown here: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx) // // Overflow is fine, just wrap unchecked { // Pick a random prime number int hash = 17; // Mash the hash together with yet another random prime number hash = (hash * 23) ^ ContractName.GetHashCode(); return(hash); } }
public override int GetHashCode() { unchecked { var hashCode = (InvoiceId != null ? InvoiceId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ InvoiceNumber; hashCode = (hashCode * 397) ^ (InvoiceNumberAsString != null ? InvoiceNumberAsString.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Total.GetHashCode(); hashCode = (hashCode * 397) ^ Subtotal.GetHashCode(); hashCode = (hashCode * 397) ^ Tax.GetHashCode(); hashCode = (hashCode * 397) ^ TaxPercentage.GetHashCode(); hashCode = (hashCode * 397) ^ InvoiceDate.GetHashCode(); hashCode = (hashCode * 397) ^ (ContractName != null ? ContractName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PeriodStartDate.GetHashCode(); hashCode = (hashCode * 397) ^ PeriodEndDate.GetHashCode(); hashCode = (hashCode * 397) ^ (Currency != null ? Currency.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (From != null ? From.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LineItems?.Sum(x => x.GetHashCode()) ?? 0); return(hashCode); } }
/// <summary> /// Serves as a hash function for a particular ExportDefinition. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> public override int GetHashCode() { return(ContractName.GetHashCode() ^ ExportTypeIdentity.GetHashCode()); }
/// <summary> /// Win - (byte[]) arg0 - кошелёк победителя, (string) arg1 - хеш вируса /// Rent - (string)arg0, (int)arg1 - хеш вируса, токен /// CreatePatent - (string)arg0, (int)arg1 - хеш вируса, rent cost /// </summary> /// <param name="contractName"></param> public void CallContract(ContractName contractName, object arg0, object arg1) { StartCoroutine(callContract(contractName, arg0, arg1)); }
public void ContractNameSearch(string name) { ContractName.EnterText(name); Console.WriteLine("Contract Name Entered"); }
public string ContractNamewatermark() { var item = ContractName.GetTextByPlaceholder(); return(item); }