public WfClientProcessCurrentInfoPageQueryResult QueryProcesses(WfClientProcessQueryCondition condition, int startRowIndex, int maximumRows, string orderBy, int totalCount)
        {
            condition.NullCheck("condition");

            OperationContext.Current.FillContextToOguServiceContext();

            WfProcessQueryCondition serverCondition = null;

            WfClientProcessQueryConditionConverter.Instance.ClientToServer(condition, ref serverCondition);

            if (orderBy.IsNullOrEmpty())
            {
                orderBy = "START_TIME DESC";
            }

            ConnectiveSqlClauseCollection connective = serverCondition.ToSqlBuilder();

            WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();

            builder.AppendItem("COMMITTED", "1");
            builder.AppendTenantCode();

            connective.Add(builder);

            QueryCondition qc = new QueryCondition(startRowIndex, maximumRows,
                                                   ORMapping.GetSelectFieldsNameSql <WfProcessCurrentInfo>(),
                                                   ORMapping.GetMappingInfo(typeof(WfProcessCurrentInfo)).TableName,
                                                   orderBy);

            qc.WhereClause += connective.ToSqlString(TSqlBuilder.Instance);

            return(QueryProcessInfo(qc, totalCount));
        }
        public WfProcessQueryCondition ClientToServer(WfClientProcessQueryCondition client, ref WfProcessQueryCondition server)
        {
            client.NullCheck("client");

            if (server == null)
            {
                server = new WfProcessQueryCondition();
            }

            server.ApplicationName             = client.ApplicationName;
            server.ProgramName                 = client.ProgramName;
            server.ProcessName                 = client.ProcessName;
            server.AssigneeExceptionFilterType = client.AssigneeExceptionFilterType.ToAssigneeExceptionFilterType();
            server.AssigneesSelectType         = client.AssigneesSelectType.ToAssigneesFilterType();

            server.AssigneesUserName  = client.AssigneesUserName;
            server.BeginStartTime     = client.BeginStartTime;
            server.EndStartTime       = client.EndStartTime;
            server.ProcessStatus      = client.ProcessStatus;
            server.DepartmentName     = client.DepartmentName;
            server.ProcessCreatorID   = client.ProcessCreatorID;
            server.ProcessCreatorName = client.ProcessCreatorName;

            foreach (WfClientUser user in client.CurrentAssignees)
            {
                server.CurrentAssignees.Add((IUser)(user.ToOguObject()));
            }

            return(server);
        }