Пример #1
0
        public Int32 GetMachinesCount(string NWIP, string WWIP, string JQRT, string GLY, string ZG)
        {
            if (NWIP != null && SqlInjection.GetString(NWIP))
            {
                return(-1);
            }

            if (WWIP != null && SqlInjection.GetString(WWIP))
            {
                return(-1);
            }

            if (JQRT != null && SqlInjection.GetString(JQRT))
            {
                return(-1);
            }

            if (GLY != null && SqlInjection.GetString(GLY))
            {
                return(-1);
            }

            if (ZG != null && SqlInjection.GetString(ZG))
            {
                return(-1);
            }

            if (machinesDal == null)
            {
                machinesDal = baseDal as IMachines;
            }

            return(machinesDal.GetMachinesCount(NWIP, WWIP, JQRT, GLY, ZG));
        }
Пример #2
0
 /// <summary>
 /// Edits a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='key'>
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MachineDto> PutByIdAsync(this IMachines operations, long key, MachineDto body = default(MachineDto), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PutByIdWithHttpMessagesAsync(key, body, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets a single machine based on its key.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='expand'>
 /// Expands related entities inline.
 /// </param>
 /// <param name='select'>
 /// Selects which properties to include in the response.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MachineDto> GetByIdAsync(this IMachines operations, long id, string expand = default(string), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetByIdWithHttpMessagesAsync(id, expand, select, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Edits a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='machineDto'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MachineDto> PutByIdAsync(this IMachines operations, long id, MachineDto machineDto, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.PutByIdWithHttpMessagesAsync(id, machineDto, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #5
0
        public List <MachinesInfo> GetMachines(string NWIP, string WWIP, string JQRT, string GLY, string ZG, PagerInfo info)
        {
            if (NWIP != null && SqlInjection.GetString(NWIP))
            {
                return(null);
            }

            if (WWIP != null && SqlInjection.GetString(WWIP))
            {
                return(null);
            }

            if (JQRT != null && SqlInjection.GetString(JQRT))
            {
                return(null);
            }

            if (GLY != null && SqlInjection.GetString(GLY))
            {
                return(null);
            }

            if (ZG != null && SqlInjection.GetString(ZG))
            {
                return(null);
            }

            if (machinesDal == null)
            {
                machinesDal = baseDal as IMachines;
            }

            return(machinesDal.GetMachines(NWIP, WWIP, JQRT, GLY, ZG, info));
        }
 /// <summary>
 /// Gets machines.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='expand'>
 /// Expands related entities inline.
 /// </param>
 /// <param name='filter'>
 /// Filters the results, based on a Boolean condition.
 /// </param>
 /// <param name='select'>
 /// Selects which properties to include in the response.
 /// </param>
 /// <param name='orderby'>
 /// Sorts the results.
 /// </param>
 /// <param name='top'>
 /// Returns only the first n results.
 /// </param>
 /// <param name='skip'>
 /// Skips the first n results.
 /// </param>
 /// <param name='count'>
 /// Includes a count of the matching results in the response.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ODataResponseListMachineDto> GetMachinesAsync(this IMachines operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetMachinesWithHttpMessagesAsync(expand, filter, select, orderby, top, skip, count, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #7
0
        public Int32 ModMachine(MachinesInfo machine)
        {
            if (machinesDal == null)
            {
                machinesDal = baseDal as IMachines;
            }

            return(machinesDal.ModMachine(machine));
        }
Пример #8
0
 public DomainContext(
     IMachines machines,
     IMeters meters,
     IMonitors monitors)
 {
     Machines = machines.Guard(nameof(machines));
     Meters   = meters.Guard(nameof(meters));
     Monitors = monitors.Guard(nameof(monitors));
 }
Пример #9
0
        public DataTable GetZG(string key)
        {
            // 检查一下key是否含有不合法的字符串
            if (SqlInjection.GetString(key))
            {
                return(null);
            }

            if (machinesDal == null)
            {
                machinesDal = baseDal as IMachines;
            }
            return(machinesDal.GetZG(key));
        }
 /// <summary>
 /// Deletes a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='ifMatch'>
 /// If-Match header
 /// </param>
 public static void DeleteById(this IMachines operations, long id, string ifMatch = default(string))
 {
     operations.DeleteByIdAsync(id, ifMatch).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Deletes a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='ifMatch'>
 /// If-Match header
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteByIdAsync(this IMachines operations, long id, string ifMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     (await operations.DeleteByIdWithHttpMessagesAsync(id, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Edits a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='machineDto'>
 /// </param>
 public static MachineDto PutById(this IMachines operations, long id, MachineDto machineDto)
 {
     return(operations.PutByIdAsync(id, machineDto).GetAwaiter().GetResult());
 }
Пример #13
0
 /// <summary>
 /// Partially updates a machine.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='key'>
 /// </param>
 /// <param name='body'>
 /// </param>
 public static void PatchById(this IMachines operations, long key, MachineDto body = default(MachineDto))
 {
     operations.PatchByIdAsync(key, body).GetAwaiter().GetResult();
 }
Пример #14
0
 /// <summary>
 /// Gets runtimes for the specified folder
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Read.
 ///
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='folderId'>
 /// </param>
 /// <param name='expand'>
 /// Indicates the related entities to be represented inline. The maximum depth
 /// is 2.
 /// </param>
 /// <param name='filter'>
 /// Restricts the set of items returned. The maximum number of expressions is
 /// 100.
 /// </param>
 /// <param name='select'>
 /// Limits the properties returned in the result.
 /// </param>
 /// <param name='orderby'>
 /// Specifies the order in which items are returned. The maximum number of
 /// expressions is 5.
 /// </param>
 /// <param name='count'>
 /// Indicates whether the total count of items within a collection are returned
 /// in the result.
 /// </param>
 public static ODataValueOfIEnumerableOfMachineRuntimeDto GetRuntimesForFolderByFolderid(this IMachines operations, long folderId, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), bool?count = default(bool?))
 {
     return(operations.GetRuntimesForFolderByFolderidAsync(folderId, expand, filter, select, orderby, count).GetAwaiter().GetResult());
 }
Пример #15
0
 /// <summary>
 /// Partially updates a machine.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='key'>
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PatchByIdAsync(this IMachines operations, long key, MachineDto body = default(MachineDto), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PatchByIdWithHttpMessagesAsync(key, body, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Deletes multiple machines based on their keys.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='machinesDeleteBulk'>
 /// </param>
 public static void DeleteBulk(this IMachines operations, MachinesDeleteBulk machinesDeleteBulk)
 {
     operations.DeleteBulkAsync(machinesDeleteBulk).GetAwaiter().GetResult();
 }
Пример #17
0
 /// <summary>
 /// Gets machines.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Read.
 ///
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='expand'>
 /// Indicates the related entities to be represented inline. The maximum depth
 /// is 2.
 /// </param>
 /// <param name='filter'>
 /// Restricts the set of items returned. The maximum number of expressions is
 /// 100.
 /// </param>
 /// <param name='select'>
 /// Limits the properties returned in the result.
 /// </param>
 /// <param name='orderby'>
 /// Specifies the order in which items are returned. The maximum number of
 /// expressions is 5.
 /// </param>
 /// <param name='top'>
 /// Limits the number of items returned from a collection. The maximum value is
 /// 1000.
 /// </param>
 /// <param name='skip'>
 /// Excludes the specified number of items of the queried collection from the
 /// result.
 /// </param>
 /// <param name='count'>
 /// Indicates whether the total count of items within a collection are returned
 /// in the result.
 /// </param>
 public static ODataValueOfIEnumerableOfExtendedMachineDto Get(this IMachines operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?))
 {
     return(operations.GetAsync(expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult());
 }
Пример #18
0
 /// <summary>
 /// Deletes a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='key'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteByIdAsync(this IMachines operations, long key, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteByIdWithHttpMessagesAsync(key, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #19
0
 /// <summary>
 /// Deletes a machine based on its key.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='key'>
 /// </param>
 public static void DeleteById(this IMachines operations, long key)
 {
     operations.DeleteByIdAsync(key).GetAwaiter().GetResult();
 }
Пример #20
0
 /// <summary>
 /// Deletes multiple machines based on their keys.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 public static void DeleteBulk(this IMachines operations, MachineDeleteBulkRequest body = default(MachineDeleteBulkRequest))
 {
     operations.DeleteBulkAsync(body).GetAwaiter().GetResult();
 }
Пример #21
0
 /// <summary>
 /// Gets runtimes for the specified folder
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Read.
 ///
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='folderId'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ODataValueIEnumerableMachineRuntimeDto> GetRuntimesForFolderByFolderidAsync(this IMachines operations, long folderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetRuntimesForFolderByFolderidWithHttpMessagesAsync(folderId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #22
0
 /// <summary>
 /// Gets runtimes for the specified folder
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Read.
 ///
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='folderId'>
 /// </param>
 public static ODataValueIEnumerableMachineRuntimeDto GetRuntimesForFolderByFolderid(this IMachines operations, long folderId)
 {
     return(operations.GetRuntimesForFolderByFolderidAsync(folderId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Partially updates a machine.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='machineDto'>
 /// </param>
 public static void PatchById(this IMachines operations, long id, MachineDto machineDto)
 {
     operations.PatchByIdAsync(id, machineDto).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Gets machines.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='expand'>
 /// Expands related entities inline.
 /// </param>
 /// <param name='filter'>
 /// Filters the results, based on a Boolean condition.
 /// </param>
 /// <param name='select'>
 /// Selects which properties to include in the response.
 /// </param>
 /// <param name='orderby'>
 /// Sorts the results.
 /// </param>
 /// <param name='top'>
 /// Returns only the first n results.
 /// </param>
 /// <param name='skip'>
 /// Skips the first n results.
 /// </param>
 /// <param name='count'>
 /// Includes a count of the matching results in the response.
 /// </param>
 public static ODataResponseListMachineDto GetMachines(this IMachines operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?))
 {
     return(operations.GetMachinesAsync(expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Partially updates a machine.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='machineDto'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PatchByIdAsync(this IMachines operations, long id, MachineDto machineDto, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     (await operations.PatchByIdWithHttpMessagesAsync(id, machineDto, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #26
0
 /// <summary>
 /// Gets runtimes for the specified folder
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Read.
 ///
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='folderId'>
 /// </param>
 /// <param name='expand'>
 /// Indicates the related entities to be represented inline. The maximum depth
 /// is 2.
 /// </param>
 /// <param name='filter'>
 /// Restricts the set of items returned. The maximum number of expressions is
 /// 100.
 /// </param>
 /// <param name='select'>
 /// Limits the properties returned in the result.
 /// </param>
 /// <param name='orderby'>
 /// Specifies the order in which items are returned. The maximum number of
 /// expressions is 5.
 /// </param>
 /// <param name='count'>
 /// Indicates whether the total count of items within a collection are returned
 /// in the result.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ODataValueOfIEnumerableOfMachineRuntimeDto> GetRuntimesForFolderByFolderidAsync(this IMachines operations, long folderId, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), bool?count = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetRuntimesForFolderByFolderidWithHttpMessagesAsync(folderId, expand, filter, select, orderby, count, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Deletes multiple machines based on their keys.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='machinesDeleteBulk'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteBulkAsync(this IMachines operations, MachinesDeleteBulk machinesDeleteBulk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     (await operations.DeleteBulkWithHttpMessagesAsync(machinesDeleteBulk, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Creates a new machine.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.Create.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='machineDto'>
 /// </param>
 public static MachineDto Post(this IMachines operations, MachineDto machineDto)
 {
     return(operations.PostAsync(machineDto).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets a single machine based on its key.
 /// </summary>
 /// <remarks>
 /// Required permissions: Machines.View.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='expand'>
 /// Expands related entities inline.
 /// </param>
 /// <param name='select'>
 /// Selects which properties to include in the response.
 /// </param>
 public static MachineDto GetById(this IMachines operations, long id, string expand = default(string), string select = default(string))
 {
     return(operations.GetByIdAsync(id, expand, select).GetAwaiter().GetResult());
 }
Пример #30
0
 /// <summary>
 /// Deletes multiple machines based on their keys.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Machines or Machines.Write.
 ///
 /// Required permissions: Machines.Delete.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteBulkAsync(this IMachines operations, MachineDeleteBulkRequest body = default(MachineDeleteBulkRequest), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteBulkWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }