当前位置: 首页>>代码示例>>C#>>正文


C# TicketingTypes.Coupon类代码示例

本文整理汇总了C#中iLabs.DataTypes.TicketingTypes.Coupon的典型用法代码示例。如果您正苦于以下问题:C# Coupon类的具体用法?C# Coupon怎么用?C# Coupon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Coupon类属于iLabs.DataTypes.TicketingTypes命名空间,在下文中一共展示了Coupon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateLabTask

        /// <summary>
        /// Parses the appInfo and experiment ticket, inserts the task into the database and
        /// creates a dataManager and dataSources defined in the appInfo.
        /// </summary>
        /// <param name="appInfo"></param>
        /// <param name="expCoupon"></param>
        /// <param name="expTicket"></param>
        /// <returns></returns>
        public virtual LabTask CreateLabTask(LabAppInfo appInfo, Coupon expCoupon, Ticket expTicket)
        {
            LabTask labTask = CreateLabTask(appInfo, expTicket);

            if (((labTask.storage != null) && (labTask.storage.Length > 0)))
            {
                // Create DataSourceManager to manage dataSources
                DataSourceManager dsManager = new DataSourceManager();

                // set up an experiment storage handler
                ExperimentStorageProxy ess = new ExperimentStorageProxy();
                ess.OperationAuthHeaderValue = new OperationAuthHeader();
                ess.OperationAuthHeaderValue.coupon = expCoupon;
                ess.Url = labTask.storage;
                dsManager.essProxy = ess;
                dsManager.ExperimentID = labTask.experimentID;
                dsManager.AppKey = appInfo.appKey;
                // Note these dataSources are written to by the application and sent to the ESS
                if ((appInfo.dataSources != null) && (appInfo.dataSources.Length > 0))
                {
                    string[] sources = appInfo.dataSources.Split(',');
                    // Use the experimentID as the storage parameter
                    foreach (string s in sources)
                    {
                       // dsManager.AddDataSource(createDataSource(s));
                    }
                }
                TaskProcessor.Instance.AddDataManager(labTask.taskID, dsManager);
            }
            TaskProcessor.Instance.Add(labTask);
            return labTask;
        }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:40,代码来源:LabTaskFactory.cs

示例2: CreateBeeDataSource

 public FileWatcherDataSource CreateBeeDataSource(Coupon expCoupon, LabTask task, string recordType, bool flushFile)
 {
     string outputDir = ConfigurationManager.AppSettings["chamberOutputDir"];
     string outputFile = ConfigurationManager.AppSettings["chamberOutputFile"];
     string filePath = outputDir + @"\" + outputFile;
     // Stop the controller and flush the data file
     if (flushFile)
     {
         //Flush the File
         FileInfo fInfo = new FileInfo(filePath);
         using (FileStream inFile = fInfo.Open(FileMode.Truncate)) { }
     }
     string pushChannel = ChecksumUtil.ToMD5Hash("BEElab" + task.experimentID);
     //Add BEElab specific attributes
     BeeEventHandler bEvt = new BeeEventHandler(expCoupon, task.experimentID, task.storage,
         recordType, ProcessAgentDB.ServiceGuid);
     bEvt.PusherChannel = pushChannel;
     //DataSourceManager dsManager = TaskProcessor.Instance.GetDataManager(task.taskID);
     FileWatcherDataSource fds = new FileWatcherDataSource();
     fds.Path = outputDir;
     fds.Filter = outputFile;
     fds.AddFileSystemEventHandler(bEvt.OnChanged);
     //dsManager.AddDataSource(fds);
     //fds.Start();
     return fds;
 }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:26,代码来源:BeeAPI.cs

示例3: BeeEventHandler

 public BeeEventHandler(Coupon opCoupon, long experimentId,
     string essUrl, string recordType, string submitter)
 {
     this.opCoupon = opCoupon;
     this.experimentID = experimentId;
     this.essUrl = essUrl;
     this.recordType = recordType;
     this.submitter = submitter;
 }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:9,代码来源:BeeEventHandler.cs

示例4: btnGetTimeOfDay_Click

        protected void btnGetTimeOfDay_Click(object sender, EventArgs e)
        {
            Coupon opCoupon = new Coupon(issuerGuid, Int64.Parse(couponId), passkey);

            lsOpHeader.coupon = opCoupon;
            todInterface.OperationAuthHeaderValue = lsOpHeader;

            string time = todInterface.ReturnTimeOfDay();
            lblGetTimeOfDay.Text = time;
        }
开发者ID:tordf,项目名称:iLabs,代码行数:10,代码来源:Redirect.aspx.cs

示例5: CreateDataSourceManager

        // Create DataSourceManager to manage dataSources
        public DataSourceManager CreateDataSourceManager(LabTask task, Coupon expCoupon)
        {
            DataSourceManager dsManager = new DataSourceManager();

                // set up an experiment storage handler
                ExperimentStorageProxy ess = new ExperimentStorageProxy();
                ess.OperationAuthHeaderValue = new OperationAuthHeader();
                ess.OperationAuthHeaderValue.coupon = expCoupon;
                ess.Url = task.storage;
                dsManager.essProxy = ess;
                dsManager.ExperimentID = task.experimentID;
                //dsManager.AppKey = task.labAppID.;
                return dsManager;
        }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:15,代码来源:BeeAPI.cs

示例6: ProcessAgentInfo

 /// <summary>
 /// 
 /// </summary>
 /// <param name="id"></param>
 /// <param name="guid">The globally unique identifier for the service, this may not be modified.</param>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="codeBase"></param>
 /// <param name="servicePage"></param>
 /// <param name="inCoupon">The coupon for incoming messages from the processagent to the local service</param>
 /// <param name="outCoupon">The coupon for messages from the local service to this processAgent</param>
 public ProcessAgentInfo(int id, string guid, string name, int type,
     string domainGuid, string codeBase, string servicePage,
     string issuerGuid, Coupon inCoupon, Coupon outCoupon)
 {
     agentId = id;
     agentGuid = guid;
     agentName = name;
     agentType = (ProcessAgentType.AgentType) type;
     this.domainGuid = domainGuid;
     codeBaseUrl = codeBase;
     webServiceUrl = servicePage;
     this.issuerGuid = issuerGuid;
     identIn = inCoupon;
     identOut = outCoupon;
 }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:26,代码来源:ProcessAgentInfo.cs

示例7: CreateLabTask

        public override LabTask CreateLabTask(LabAppInfo appInfo, Coupon expCoupon, Ticket expTicket)
        {

            long experimentID = -1;
            LabTask task = null;

            //Parse experiment payload 	
            string payload = expTicket.payload;
            XmlQueryDoc expDoc = new XmlQueryDoc(payload);

            string experimentStr = expDoc.Query("ExecuteExperimentPayload/experimentID");
            if ((experimentStr != null) && (experimentStr.Length > 0))
            {
                experimentID = Convert.ToInt64(experimentStr);
            }
            string sbStr = expDoc.Query("ExecuteExperimentPayload/sbGuid");



            // Check to see if an experiment with this ID is already running
            LabDB dbManager = new LabDB();
            LabTask.eStatus status = dbManager.ExperimentStatus(experimentID, sbStr);
            if (status == LabTask.eStatus.NotFound)
            {
                // Check for an existing experiment using the same resources, if found Close it

                //Create the new Task
                if(appInfo.rev.Contains("8.2")){
                   task = iLabs.LabView.LV82.LabViewTask.CreateLabTask(appInfo,expCoupon,expTicket);
                }
                else{
                     task = iLabs.LabView.LV86.LabViewTask.CreateLabTask(appInfo,expCoupon,expTicket);
                }
            }

            else
            {
                task =  TaskProcessor.Instance.GetTask(experimentID);

            }
            return task;
        }
开发者ID:tordf,项目名称:iLabs,代码行数:42,代码来源:LabViewTaskFactory.cs

示例8: AddAttributes

        public int[] AddAttributes(long experimentId, int sequenceNum, RecordAttribute[] attributes)
        {
            int[] attributeIDs = new int[attributes.Length];

            Coupon opCoupon = new Coupon(opHeader.coupon.issuerGuid, opHeader.coupon.couponId,
                 opHeader.coupon.passkey);

            try
            {
                Ticket retrievedTicket = dbTicketing.RetrieveAndVerify(opCoupon, TicketTypes.STORE_RECORDS);
                attributeIDs = experimentsAPI.AddAttributes(experimentId, retrievedTicket.issuerGuid, sequenceNum, attributes);

                return attributeIDs;
            }

            catch
            {
                throw;
            }
        }
开发者ID:tordf,项目名称:iLabs,代码行数:20,代码来源:ExperimentStorage.asmx.cs

示例9: goButton_Click

        protected void goButton_Click(object sender, System.EventArgs e)
        {
            LabDB labDB = new LabDB();

            // Update Task data for graph page. Note XmlQueryDocs are read-only
            LabTask task = labDB.GetTask(Convert.ToInt64(hdnExpId.Value), Session["opIssuer"].ToString());
            if (task != null)
            {
                Coupon opCoupon = new Coupon(task.issuerGUID, task.couponID, Session["opPasscode"].ToString());
               ExperimentStorageProxy essProxy = new ExperimentStorageProxy();
               essProxy.OperationAuthHeaderValue = new OperationAuthHeader();
               essProxy.OperationAuthHeaderValue.coupon = opCoupon;
               essProxy.Url = task.storage;
               essProxy.AddRecord(task.experimentID, "BEElab", "profile", false, hdnProfile.Value, null);
               essProxy.AddRecord(task.experimentID, "BEElab", "climateProfile", false, hdnClimateProfile.Value, null);
               essProxy.AddRecord(task.experimentID, "BEElab", "sunLamp", false, hdnSunLamp.Value, null);

               // send The CR1000 programs
               sendProfile(ConfigurationManager.AppSettings["climateController"],
                   hdnProfile.Value, hdnSunProfile, ConfigurationManager.AppSettings["climateServer"]);
               sendFile(ConfigurationManager.AppSettings["chamberController"],
                  ConfigurationManager.AppSettings["chamberFile"],
                  ConfigurationManager.AppSettings["chamberServer"]);
                StringBuilder buf = new StringBuilder("BEEgraph.aspx?expid=");

                sendEwsCientProfile(hdnClientProfile.Value,hdnExpLength.Value);
                buf.Append(task.experimentID);
                task.Status = LabTask.eStatus.Running;
                TaskProcessor.Instance.Modify(task);
                labDB.SetTaskStatus(task.taskID, (int) LabTask.eStatus.Running);
                Session["opCouponID"] = hdnCoupon.Value;
                Session["opIssuer"] = hdnIssuer.Value;
                Session["opPasscode"] = hdnPasscode.Value;
                Response.Redirect(buf.ToString(), true);
            }
            else
            {
                throw new Exception("Task was not found.");
            }
        }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:40,代码来源:BEEstartAll.aspx.cs

示例10: AddBlobToRecord

        public bool AddBlobToRecord(long blobId, long experimentId, int sequenceNum)
        {
            bool blobAdded = false;

            Coupon opCoupon = new Coupon(opHeader.coupon.issuerGuid, opHeader.coupon.couponId,
                 opHeader.coupon.passkey);

            string ticketType = TicketTypes.STORE_RECORDS;

            try
            {
                Ticket retrievedTicket = dbTicketing.RetrieveAndVerify(opCoupon, ticketType);

                blobAdded = blobsAPI.AddBlobToRecord(blobId, experimentId, retrievedTicket.issuerGuid, sequenceNum);
                return blobAdded;
            }

            catch
            {
                throw;
            }
        }
开发者ID:tordf,项目名称:iLabs,代码行数:22,代码来源:ExperimentStorage.asmx.cs

示例11: btnRequestBlobAccess_Click

        protected void btnRequestBlobAccess_Click(object sender, EventArgs e)
        {
            Coupon opCoupon = new Coupon(issuerGuid, Int64.Parse(couponId), passkey);

            lsOpHeader.coupon = opCoupon;
            todInterface.OperationAuthHeaderValue = lsOpHeader;

            long experimentId = todInterface.GetExperimentId();
            long blobId = todInterface.GetBlobId();

            essOpHeader.coupon = opCoupon;
            //blobStorage.OperationAuthHeaderValue = essOpHeader;
            essInterface.OperationAuthHeaderValue = essOpHeader;

            //string blobUrl = blobStorage.RequestBlobAccess(blobId, "http", 30);
            string blobUrl = essInterface.RequestBlobAccess(blobId, "http", 30);

            Image1.Visible = true;
            Image1.ImageUrl = blobUrl;

            Label1.Text = lblGetTimeOfDay.Text;
        }
开发者ID:tordf,项目名称:iLabs,代码行数:22,代码来源:Redirect.aspx.cs

示例12: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // retrieve parameters from URL
                couponId = Request.QueryString["coupon_id"];
                passkey = Request.QueryString["passkey"];
                issuerGuid = Request.QueryString["issuer_guid"];
                sbUrl = Request.QueryString["sb_url"];
                labUrl= ConfigurationManager.AppSettings["labUrl"];

                if (passkey != null && couponId != null && issuerGuid != null)
                {
                    try
                    {
                        //set execution coupon and ticket type
                        Coupon executionCoupon = new Coupon(issuerGuid, Int64.Parse(couponId), passkey);
                        string type = TicketTypes.EXECUTE_EXPERIMENT;

                        // retrieve the ticket and verify it
                        Ticket retrievedTicket = dbTicketing.RetrieveAndVerify(executionCoupon, type);

                    }

                    catch
                    {
                        Response.Redirect("Default.aspx" + "?sb_url=" + sbUrl);
                    }
                    Response.Redirect(labUrl + "?passkey=" + passkey + "&sbUrl=" + sbUrl);

                }

                else
                {
                    Response.Redirect("Default.aspx" + "?sb_url=" + sbUrl);
                }
            }
        }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:38,代码来源:Redirect.aspx.cs

示例13: AddTicket

        /// <summary>
        /// 
        /// </summary>
        /// <param name="coupon"></param>
        /// <param name="type"></param>
        /// <param name="redeemerGuid"></param>
        /// <param name="sponsorGuid"></param>
        /// <param name="expiration"></param>
        /// <param name="payload"></param>
        /// <returns>The added Ticket, or null of the ticket cannot be added</returns>
        public Ticket AddTicket(Coupon coupon, 
            string type, string redeemerGuid, string sponsorGuid, long expiration, string payload)
        {
            Ticket ticket = null;
            // create sql connection
            DbConnection connection = FactoryDB.GetConnection();

            try
            {
                connection.Open();
                if (AuthenticateIssuedCoupon(connection, coupon))
                {
                    ticket = InsertIssuedTicket(connection, coupon.couponId, redeemerGuid, sponsorGuid,
                        type, expiration, payload);
                }
            }

            finally
            {
                connection.Close();
            }

            return ticket;
        }
开发者ID:gumpyoung,项目名称:ilabproject-code,代码行数:34,代码来源:TicketIssuerDB.cs

示例14: GetBlobStatus

        public int GetBlobStatus(long blobId)
        {
            int status = -1;

            Coupon opCoupon = new Coupon(opHeader.coupon.issuerGuid, opHeader.coupon.couponId,
                 opHeader.coupon.passkey);

            string ticketType = TicketTypes.RETRIEVE_RECORDS;

            try
            {
                Ticket retrievedTicket = dbTicketing.RetrieveAndVerify(opCoupon, ticketType);
                status = blobsAPI.GetBlobStatus(blobId);
                return status;
            }
            catch
            {
                throw;
            }
        }
开发者ID:tordf,项目名称:iLabs,代码行数:20,代码来源:ExperimentStorage.asmx.cs

示例15: RequestBlobStorage

        public bool RequestBlobStorage(long blobId, string blobUrl)
        {
            Coupon opCoupon = new Coupon(opHeader.coupon.issuerGuid, opHeader.coupon.couponId,
                 opHeader.coupon.passkey);

            try
            {
                Ticket retrievedTicket = dbTicketing.RetrieveAndVerify(opCoupon, TicketTypes.STORE_RECORDS);

                try
                {
                    return blobsAPI.RequestBlobStorage(blobId, blobUrl);
                }

                catch
                {
                    return false;
                }
            }
            catch
            {
                throw;
            }
        }
开发者ID:tordf,项目名称:iLabs,代码行数:24,代码来源:ExperimentStorage.asmx.cs


注:本文中的iLabs.DataTypes.TicketingTypes.Coupon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。