Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void swapShift(string shiftDate, string otherID)
- {
- var url = "https://myshiftplannercloud.azurewebsites.net/api/ChatBot/SwapShift?employeeID=joe512";
- var syncClient = new WebClient();
- var data = "&date=" + shiftDate + "&swapwith=" + otherID;
- syncClient.UploadString(url, data);
- }
- // Other (hopefully) unrelated code goes here
- if (activity.Text.ToUpper().Contains("SWAP"))
- {
- ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
- string dateInput = activity.Text.Substring((activity.Text.IndexOf("/") - 2), 8);
- DateTime date = DateTime.ParseExact(dateInput, "dd/MM/yy", CultureInfo.InvariantCulture);
- string dateOutput = date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
- string userID = "Frank";
- swapShift(dateOutput, userID);
- Activity reply = activity.CreateReply($"I've swapped your shift with " + userID + " and let your manager know");
- await connector.Conversations.ReplyToActivityAsync(reply);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement