private void btnSaveContract_Click(object sender, EventArgs e) { IEnumerable <string> brokenRules; ContractID id = new ContractID(currentContract.StartDate.Year, currentContract.FK_ContractTypeId, currentContract.FK_ServiceLevelId); currentContract.Id = id.ToString(); bool isValid = currentContract.Validate(out brokenRules); string msg = "Invalid input. Please check the error box"; if (isValid) { if (contractInsert) { currentContract.Insert(); msg = "Contract inserted"; ((Client)currentPerson).Contracts.Add(currentContract); } else { currentContract.Update(); msg = "Contract updated"; } contractInsert = contractEdit = false; refreshContracts(); } lstContractError.DataSource = brokenRules.ToList(); MessageBox.Show(msg, "Modification Status", MessageBoxButtons.OK, isValid ? MessageBoxIcon.Information : MessageBoxIcon.Error); }
internal ContractUpdateTransactionBody(UpdateContractParams updateParameters) : this() { if (updateParameters is null) { throw new ArgumentNullException(nameof(updateParameters), "Contract Update Parameters argument is missing. Please check that it is not null."); } if (updateParameters.Contract is null) { throw new ArgumentNullException(nameof(updateParameters.Contract), "Contract address is missing. Please check that it is not null."); } if (updateParameters.Expiration is null && updateParameters.Administrator is null && updateParameters.RenewPeriod is null && updateParameters.Memo is null) { throw new ArgumentException("The Contract Updates contains no update properties, it is blank.", nameof(updateParameters)); } ContractID = new ContractID(updateParameters.Contract); if (updateParameters.Expiration.HasValue) { ExpirationTime = new Timestamp(updateParameters.Expiration.Value); } if (!(updateParameters.Administrator is null)) { AdminKey = new Key(updateParameters.Administrator); } if (updateParameters.RenewPeriod.HasValue) { AutoRenewPeriod = new Duration(updateParameters.RenewPeriod.Value); } if (!string.IsNullOrWhiteSpace(updateParameters.Memo)) { MemoWrapper = updateParameters.Memo; } }
public IEnumerable <string> BrokenRules(Contract entity) { ContractID contractID = new ContractID(entity.Id); IEnumerable <string> contractIdBrokenRules; contractID.Validate(out contractIdBrokenRules); foreach (string item in contractIdBrokenRules) { yield return(item); } if (IsZeroOrEmpty(entity.FK_ContractTypeId)) { yield return("A contract type has to be selected"); } if (IsDateTimeEmpty(entity.StartDate)) { yield return("A start date must be defined"); } if (IsDateTimeEmpty(entity.EndDate)) { yield return("An end date must be defined"); } if (entity.EndDate < entity.StartDate) { yield return("A contract's end date must be later than its start date"); } }
internal Key(Endorsement endorsement) : this() { switch (endorsement.Type) { case KeyType.Ed25519: Ed25519 = ByteString.CopyFrom(((Ed25519PublicKeyParameters)endorsement._data).GetEncoded()); break; case KeyType.ECDSASecp256K1: ECDSASecp256K1 = ByteString.CopyFrom(((ECPublicKeyParameters)endorsement._data).Q.GetEncoded(true)); break; case KeyType.Contract: ContractID = new ContractID((Address)endorsement._data); break; case KeyType.List: ThresholdKey = new ThresholdKey { Threshold = endorsement.RequiredCount, Keys = new KeyList((Endorsement[])endorsement._data) }; break; default: throw new InvalidOperationException("Endorsement is Empty."); } }
public void ContractIdSearch(string id) { Hooks.Driver.WaitForJQuery(100); ContractID.WaitForElementToLoad(100); ContractID.EnterText(id); Console.WriteLine("Contract ID Entered"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Bind(SlnID.ToInt(), VerID, ContractID.ToInt()); } }
protected void ProjectID_SelectedIndexChanged(object sender, EventArgs e) { //绑定合同ID ContractID.DataSource = WebBLL.Tbl_ProjectContractManager.GetTbl_ProjectContractProjectID(Convert.ToInt32(this.ProjectID.SelectedValue)); ContractID.DataTextField = "PC_Name"; ContractID.DataValueField = "ID"; ContractID.DataBind(); ContractID.Items.Insert(0, new ListItem("选择合同", "")); }
protected void ProjectID_SelectedIndexChanged(object sender, EventArgs e) { //根据不同类型绑定合同ID ContractID.DataSource = WebBLL.Tbl_ProjectOuterManager.GetDataTableByPage(100, 1, "projectid=" + ProjectID.SelectedValue + " and po_type='" + Title + "'", "");; ContractID.DataTextField = "PO_Name"; ContractID.DataValueField = "ID"; ContractID.DataBind(); ContractID.Items.Insert(0, new ListItem("选择合同", "")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtSlnID.Text = SlnID.ToString(); txtCopyID.Text = ContractID.ToString(); Bind(SlnID); } }
//Calculate a task's priority by determining the percentage of allowable waiting days that has passed public float CalculatePriority(ContractID contractID, DateTime dateAdded) { //Make "A" start at 1 int clientPriority = contractID.ClientImportance - 64; //Use the priorityMultiplier to specify how many days per priority index may pass before a task has to be completed. int maxAllowableDays = clientPriority * priorityMultiplier; TimeSpan timePassed = DateTime.Now - dateAdded; return(timePassed.Days / (float)maxAllowableDays); }
internal ContractCallLocalQuery(QueryContractParams queryParameters) : this() { if (queryParameters is null) { throw new ArgumentNullException(nameof(queryParameters), "The query parameters are missing. Please check that the argument is not null."); } ContractID = new ContractID(queryParameters.Contract); Gas = queryParameters.Gas; FunctionParameters = ByteString.CopyFrom(Abi.EncodeFunctionWithArguments(queryParameters.FunctionName, queryParameters.FunctionArgs).Span); _throwOnFail = queryParameters.ThrowOnFail; }
internal Endorsement ToEndorsement() { return(KeyCase switch { KeyOneofCase.Ed25519 => new Endorsement(KeyType.Ed25519, Ed25519.Memory), KeyOneofCase.ECDSASecp256K1 => new Endorsement(KeyType.ECDSASecp256K1, ECDSASecp256K1.Memory), KeyOneofCase.ContractID => new Endorsement(ContractID.AsAddress()), KeyOneofCase.ThresholdKey => ThresholdKey.Keys.Keys.Count == 0 ? Endorsement.None : new Endorsement(ThresholdKey.Threshold, ThresholdKey.Keys.ToEndorsements()), KeyOneofCase.KeyList => KeyList.Keys.Count == 0 ? Endorsement.None : new Endorsement(KeyList.ToEndorsements()), _ => throw new InvalidOperationException($"Unsupported Key Type {KeyCase}. Do we have a network/library version mismatch?"), });
internal ContractCallTransactionBody(Hashgraph.CallContractParams callParameters) : this() { if (callParameters is null) { throw new ArgumentNullException(nameof(callParameters), "The call parameters are missing. Please check that the argument is not null."); } ContractID = new ContractID(callParameters.Contract); Gas = callParameters.Gas; Amount = callParameters.PayableAmount; FunctionParameters = ByteString.CopyFrom(Abi.EncodeFunctionWithArguments(callParameters.FunctionName, callParameters.FunctionArgs).Span); }
internal ContractDeleteTransactionBody(Address contractToDelete, AddressOrAlias transferToAddress) : this() { if (contractToDelete is null) { throw new ArgumentNullException(nameof(contractToDelete), "Contract to Delete is missing. Please check that it is not null."); } if (transferToAddress is null) { throw new ArgumentNullException(nameof(transferToAddress), "Transfer address is missing. Please check that it is not null."); } ContractID = new ContractID(contractToDelete); TransferAccountID = new AccountID(transferToAddress); }
public void Bind() { try { int slnId = BindSolution(SlnID.ToInt()); BindEnumInfo(slnId); int verId = BindVersion(slnId); int agreementId = BindAgreement(slnId); int contractId = BindContract(slnId, verId, agreementId, ContractID.ToInt()); BindResult(slnId, verId, contractId); } catch (Exception ex) { TraceLog.WriteError("Default bind error:{0}", ex); } }
internal Hashgraph.ContractInfo ToContractInfo() { return(new Hashgraph.ContractInfo { Contract = ContractID.ToAddress(), Address = AccountID.ToAddress(), SmartContractId = ContractAccountID, Administrator = AdminKey?.ToEndorsement(), Expiration = ExpirationTime.ToDateTime(), RenewPeriod = AutoRenewPeriod.ToTimeSpan(), Size = Storage, Memo = Memo, Balance = Balance, Tokens = TokenRelationships.ToBalances(), Deleted = Deleted }); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //设置只读权限 if (Request.QueryString["type"] == "read") { btn_submit.Visible = false; ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "$(function(){$('input').attr('readonly', 'readonly');$('select').attr('disabled', 'true');$('textarea').attr('readonly', 'readonly');});", true); } //绑定合同ID ContractID.DataSource = WebBLL.Tbl_ProjectContractManager.GetTbl_ProjectContractAll(); ContractID.DataTextField = "PC_Name"; ContractID.DataValueField = "ID"; ContractID.DataBind(); Bind(); } }
protected void bt_OK_Click(object sender, EventArgs e) { int ApproveCount = 0, UnApproveCount = 0, errcount = 0; if (txt_UnApproveContractID.Text.Trim() != "") { string[] UnApproveID = Regex.Split(txt_UnApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase); if (txt_ApproveContractID.Text.Trim() != "") { string[] ApproveID = Regex.Split(txt_ApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase); foreach (string contractid in UnApproveID) { if (ApproveID.Contains(contractid)) { MessageBox.Show(this, "ID为【" + contractid + "】的返利协议同时出现在了【审批通过】与【审批不通过】编辑框中!"); return; } } } } if (txt_ApproveContractID.Text.Trim() != "") { string[] ApproveID = Regex.Split(txt_ApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase); CM_ContractBLL _bll; StringBuilder approvebuild = new StringBuilder(""); for (int i = 0; i < ApproveID.Length; i++) { int ContractID; if (!ApproveID[i].Trim().Equals("") && int.TryParse(ApproveID[i].Trim(), out ContractID)) { _bll = new CM_ContractBLL(ContractID); if (_bll.Model != null) { int jobid = EWF_TaskBLL.StaffCanApproveTask(_bll.Model.ApproveTask, 7394); if (jobid > 0) { EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid); if (job != null) { int decisionid = job.StaffCanDecide(7394); if (decisionid > 0) { ApproveCount++; job.Decision(decisionid, (int)Session["UserID"], 2, "批量审批通过!"); //2:审批已通过 approvebuild.Append("ID为【" + ContractID.ToString() + "】的返利协议审批通过 "); } } } else { approvebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未到客服确认环节 </span>"); errcount++; } } else { approvebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未能在系统中找到 </span> "); errcount++; } } else if (!ApproveID[i].Trim().Equals("") && !int.TryParse(ApproveID[i].Trim(), out ContractID)) { approvebuild.Append("<span style='color: Red'>【" + ContractID.ToString() + "】不是一个有效的返利协议ID </span> "); errcount++; } if (i % 5 == 0 && i != 0) { approvebuild.Append("<br/>"); } } lb_ApproveErrorInfo.Text = approvebuild.ToString(); } if (txt_UnApproveContractID.Text.Trim() != "") { string[] UnApproveID = Regex.Split(txt_UnApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase); CM_ContractBLL _bll; StringBuilder unapprovebuild = new StringBuilder(""); for (int i = 0; i < UnApproveID.Length; i++) { int ContractID; if (!UnApproveID[i].Trim().Equals("") && int.TryParse(UnApproveID[i].Trim(), out ContractID)) { _bll = new CM_ContractBLL(ContractID); if (_bll.Model != null) { int jobid = EWF_TaskBLL.StaffCanApproveTask(_bll.Model.ApproveTask, 7394); if (jobid > 0) { EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid); if (job != null) { int decisionid = job.StaffCanDecide(7394); if (decisionid > 0) { UnApproveCount++; job.Decision(decisionid, (int)Session["UserID"], 3, "批量审批不通过!"); //3:审批不通过 unapprovebuild.Append("ID为【" + ContractID.ToString() + "】的返利协议审批未通过 "); } } } else { unapprovebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未到客服确认环节 </span>"); errcount++; } } else { errcount++; unapprovebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未能在系统中找到 </span>"); } } else if (!UnApproveID[i].Trim().Equals("") && !int.TryParse(UnApproveID[i].Trim(), out ContractID)) { unapprovebuild.Append("<span style='color: Red'>【" + ContractID.ToString() + "】不是一个有效的返利协议ID </span>"); errcount++; } if (i % 5 == 0 && i != 0) { unapprovebuild.Append("<br/>"); } } lb_UnApproveErrorInfo.Text = unapprovebuild.ToString(); } MessageBox.Show(this, "审批通过协议个数:" + ApproveCount.ToString() + @"\n审批未通过协议个数:" + UnApproveCount.ToString() + @"\n未能导入协议个数:" + errcount.ToString()); return; }
public string ContractIdwatermark() { var item = ContractID.GetTextByPlaceholder(); return(item); }
internal ContractGetBytecodeQuery(Address contract) : this() { ContractID = new ContractID(contract); }
internal ContractGetInfoQuery(Address contract) : this() { ContractID = new ContractID(contract); }
internal ContractGetRecordsQuery(Address contract) : this() { ContractID = new ContractID(contract); }
internal static Address FromContractID(ContractID contract) { return(new Address(contract.ShardNum, contract.RealmNum, contract.ContractNum)); }