HeapDataManger.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Web;
  3. using System.Collections;
  4. using System.Web.Services;
  5. using System.Web.Services.Protocols;
  6. /// <summary>
  7. /// Summary description for HeapDataManger
  8. /// </summary>
  9. [WebService(Namespace = "http://tempuri.org/")]
  10. [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  11. public class HeapDataManger : System.Web.Services.WebService
  12. {
  13.     public HeapDataManger()
  14.     {
  15.         //Uncomment the following line if using designed components 
  16.         //InitializeComponent(); 
  17.     }
  18.     [WebMethod]
  19.     public bool ExistItem(
  20.         string InstanceId,
  21.         string ItemName)
  22.     {
  23.         return OThinker.H3.Server.Engine.HeapDataManager.ExistItem(
  24.             InstanceId,
  25.             ItemName);
  26.     }
  27.     [WebMethod]
  28.     public long CreateItem(
  29.         string InstanceId,
  30.         string ItemName,
  31.         bool Memory,
  32.         byte[] SerializedValue)
  33.     {
  34.         object itemValue = OThinker.Data.Convertor.ByteArrayToObject(SerializedValue, false);
  35.         return OThinker.H3.Server.Engine.HeapDataManager.CreateItem(
  36.             InstanceId,
  37.             ItemName,
  38.             Memory,
  39.             itemValue);
  40.     }
  41.     // 获得所有的数据项名称
  42.     [WebMethod]
  43.     public string[] GetAllItemNames(string InstanceId)
  44.     {
  45.         return OThinker.H3.Server.Engine.HeapDataManager.GetAllItemNames(InstanceId);
  46.     }
  47.     // 获得所有的数据项
  48.     [WebMethod]
  49.     public byte[] GetAllItems(string InstanceId)
  50.     {
  51.         System.Collections.Specialized.ListDictionary dict
  52.             = OThinker.H3.Server.Engine.HeapDataManager.GetAllItems(InstanceId);
  53.         return OThinker.Data.Convertor.ObjectToByteArray(dict, false);
  54.     }
  55.     [WebMethod]
  56.     public byte[] GetItemValue(
  57.         string InstanceId,
  58.         string ItemName)
  59.     {
  60.         object itemValue = OThinker.H3.Server.Engine.HeapDataManager.GetItemValue(
  61.             InstanceId,
  62.             ItemName);
  63.         return OThinker.Data.Convertor.ObjectToByteArray(itemValue, false);
  64.     }
  65.     [WebMethod]
  66.     public long SetItemValue(
  67.         string InstanceId,
  68.         string ItemName,
  69.         byte[] SerializedValue)
  70.     {
  71.         object itemValue = OThinker.Data.Convertor.ByteArrayToObject(SerializedValue, false);
  72.         return OThinker.H3.Server.Engine.HeapDataManager.SetItemValue(InstanceId, ItemName, itemValue);
  73.     }
  74. }