public override string CalculateFingerprint() { List <string> parts = new List <string>(); parts.Add(ResultTypeID.ToString()); parts.Add(OperatorID.ToString()); foreach (var item in Arguments) { parts.Add(item.CalculateFingerprint()); } return(string.Join("_", parts)); }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", ReceivedID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillItemID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Amount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ReceivedType.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", PayID.ToString(), WebServiceConst.Separater_1); if (ReceivedTime.HasValue) { sb.AppendFormat("{0}{1}", ReceivedTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); if (ToAcountTime.HasValue) { sb.AppendFormat("{0}{1}", ToAcountTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } if (ToAccountID.HasValue) { sb.AppendFormat("{0}{1}", ToAccountID.Value.ToString(), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", OperatorID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Explain, WebServiceConst.Separater_1); sb.Append(DeductionID.ToString()); return(sb.ToString()); }
protected override void Execute(CodeActivityContext context) { // Open the config file and get the connection string Configuration config = WebConfigurationManager.OpenWebConfiguration("/RequestWeb"); ConnectionStringsSection css = (ConnectionStringsSection)config.GetSection("connectionStrings"); string connectionString = css.ConnectionStrings["Request"].ConnectionString; // Lookup the Queue RequestDataContext dc = new RequestDataContext(connectionString); // Lookup the Request dc.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, dc.Requests); Request r = dc.Requests.SingleOrDefault(x => x.RequestKey == RequestKey.Get(context)); if (r == null) { throw new InvalidProgramException("The specified request (" + RequestKey.Get(context) + ") was not found"); } if (r.AssignedOperator != null) { if (r.AssignedOperator != OperatorID.Get(context)) { Result.Set(context, -1); return; } } r.AssignedOperator = OperatorID.Get(context); r.AssignedDate = DateTime.UtcNow; // Update the Request record PersistRequest persist = context.GetExtension <PersistRequest>(); persist.AddRequest(r); Result.Set(context, 0); }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", BillItemID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Subject.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrSubject, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", SubjectType.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Amount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", DueAmt.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ReceivedAmt.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", PenaltyIntAmt.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); if (FullPaidTime.HasValue) { sb.AppendFormat("{0}{1}", FullPaidTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", OperatorID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", IsCurrent.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", IsShelve.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrAmount, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrDueAmt, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrReceivedAmt, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrReceived, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrReceivable, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Display, WebServiceConst.Separater_1); sb.Append(StrCreateTime); return(sb.ToString()); }
protected void lvBDOperator_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 OperatorID; Int64.TryParse(e.CommandArgument.ToString(), out OperatorID); if (OperatorID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _OperatorID = OperatorID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(BDOperatorEntity.FLD_NAME_OperatorID, OperatorID.ToString(), SQLMatchType.Equal); BDOperatorEntity bDOperatorEntity = new BDOperatorEntity(); result = FCCBDOperator.GetFacadeCreate().Delete(bDOperatorEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _OperatorID = 0; _BDOperatorEntity = new BDOperatorEntity(); PrepareInitialView(); BindBDOperatorList(); MiscUtil.ShowMessage(lblMessage, "Operator has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Operator.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
protected override void Execute(CodeActivityContext context) { // Open the config file and get the connection string Configuration config = WebConfigurationManager.OpenWebConfiguration("/RequestWeb"); ConnectionStringsSection css = (ConnectionStringsSection)config.GetSection("connectionStrings"); string connectionString = css.ConnectionStrings["Request"].ConnectionString; // Lookup the Queue RequestDataContext dc = new RequestDataContext(connectionString); Queue queue = dc.Queues.SingleOrDefault(x => x.QueueName == QueueName.Get(context)); if (queue == null) { throw new InvalidProgramException("The specified queue (" + QueueName.Get(context) + ") was not found"); } if (queue.AllowSelection) { IEnumerable <Request> q = dc.Requests .Where(x => x.Queue.QueueName == QueueName.Get(context) && x.QC == QC.Get(context) && (x.AssignedOperator == null || x.AssignedOperator == OperatorID.Get(context))) .OrderBy(x => x.AssignedDate); if (q.Count() > 0) { Request[] reqList = new Request[q.Count()]; int i = 0; foreach (Request r in q) { reqList[i++] = r; } RequestList.Set(context, reqList); } } else { IEnumerable <Request> q = dc.Requests .Where(x => x.Queue.QueueName == QueueName.Get(context) && x.QC == QC.Get(context) && (x.AssignedOperator == null || x.AssignedOperator == OperatorID.Get(context))) .OrderBy(x => x.AssignedDate) .Take(1); if (q.Count() > 0) { Request r = q.First <Request>(); r.AssignedOperator = OperatorID.Get(context); dc.SubmitChanges(); Request[] reqList = new Request[1]; reqList[0] = r; RequestList.Set(context, reqList); } } }