using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace SagaProcessor
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
ATSSagaProcessor asp = new ATSSagaProcessor("finseldemos", "", "EszaEnqThvqlMyBkct9ELzGSfm30r6l6q890XoxsN+gezNVFZNGhmlaXGmdrhFlV2870N0yMoFOgi8MbQGEEmQ==", "SharedKey");
public void siNotification(string Notification)
{
if (txtNotification.Text.Length > 4096)
txtNotification.Text = "";
txtNotification.Text = Notification + " " + DateTime.Now.ToLongTimeString() + "\r\n" + txtNotification.Text;
Application.DoEvents();
}
private void btnProcess_Click(object sender, EventArgs e)
{
asp.GetRequests();
}
private void Form1_Load(object sender, EventArgs e)
{
asp.OnLogHandler(siNotification);
}
private void button1_Click(object sender, EventArgs e)
{
string queueInitialCreationEntity = "\n\t{0}\n\t_SummaryPending\n\t";
string newID = Guid.NewGuid().ToString();
System.Text.StringBuilder sb = new StringBuilder();
Random r = new Random();
string tmpTable =string.Format("newtable{0:d5}",r.Next());
sb.AppendFormat("{0}{1}{2}{3}",
newID, "finseldemos", "EszaEnqThvqlMyBkct9ELzGSfm30r6l6q890XoxsN+gezNVFZNGhmlaXGmdrhFlV2870N0yMoFOgi8MbQGEEmQ==", tmpTable);
sb.AppendFormat("{0}{1}{2}",
"finseldemos", "EszaEnqThvqlMyBkct9ELzGSfm30r6l6q890XoxsN+gezNVFZNGhmlaXGmdrhFlV2870N0yMoFOgi8MbQGEEmQ==", "codestockservices");
sb.AppendFormat("{0}{1}{2}{3}",
"finseldemos", "EszaEnqThvqlMyBkct9ELzGSfm30r6l6q890XoxsN+gezNVFZNGhmlaXGmdrhFlV2870N0yMoFOgi8MbQGEEmQ==", "public", "CalendarDemo.xml");
sb.AppendFormat("http://finseldemos.blob.core.windows.net/public/CalendarDemo.xml");
string queueMessage = sb.ToString();
Finsel.AzureCommands.AzureTableStorage ats = new Finsel.AzureCommands.AzureTableStorage("finseldemos", "", "EszaEnqThvqlMyBkct9ELzGSfm30r6l6q890XoxsN+gezNVFZNGhmlaXGmdrhFlV2870N0yMoFOgi8MbQGEEmQ==", "SharedKey");
Finsel.AzureCommands.azureResults ar = ats.Tables(Finsel.AzureCommands.cmdType.post, "codestockservices");
ar = ats.Entities(Finsel.AzureCommands.cmdType.post, "codestockservices", newID, "_Summary", string.Format(queueInitialCreationEntity, newID), "", "");
Finsel.AzureCommands.AzureQueueStorage aqs = new Finsel.AzureCommands.AzureQueueStorage("finseldemos", "", "EszaEnqThvqlMyBkct9ELzGSfm30r6l6q890XoxsN+gezNVFZNGhmlaXGmdrhFlV2870N0yMoFOgi8MbQGEEmQ==", "SharedKey");
ar = aqs.Queues(Finsel.AzureCommands.cmdType.put, "codestockservices", null, new Hashtable());
ar = aqs.Messages(Finsel.AzureCommands.cmdType.post, "codestockservices", queueMessage, null, null);
}
}
}