protected void GetNewQueryData(string Ticket, string UserChat) {// Navigated from Help.xaml or ChatPage when user initiates 'Still not satisfied' a new query try { UC_Query = new CustomControls.UC_QueryMore(); UC_Query.DataContext = 1; stpnQueryMore.Children.Add(UC_Query); txtTicket.Text = "TICKET #" + Ticket.ToString(); CustomControls.UC_Chat_User uc = new CustomControls.UC_Chat_User(); pt = new Model.ParentTicket(); pt.issue = UserChat; pt.resolved = false; // pt.createdAt = String.Format("{0:dd MMM, yyyy HH:mm}", System.DateTime.Now);// 17 Jul, 2015 12:33 pt.createdAt = String.Format("{0:MMM dd, yyyy h:mm:ss tt}", System.DateTime.Now); // "Sunday, March 9, 2008" uc.DataContext = pt; stpn_ChatPanel.Children.Add(uc); GetMobikwikStaticRespone(System.DateTime.Now); GetMoreQurery(); } catch (Exception ex) { //List<Parameter> Params = new List<Parameter>(); //Params.Add(AccountFunctions.createParameter("Location", "Faq Chat")); //Params.Add(AccountFunctions.createParameter("Method", "GetNewQueryData, Error:" + ex.Message)); //FlurryWP8SDK.Api.LogEvent("FAQ Exception", Params); } }
protected void GetChatByParentTicket() { try { bool Last_CommentByMobikwik = false; stpn_ChatPanel.Children.Clear(); CustomControls.UC_Chat_User uc;//chat by user CustomControls.UC_Chat_Mobikwik ucM;// Chat by mobikwik vm = new ViewModel.VM_faq_PastIssues(); Model.Datum data = vm.GetTicketDetailByID(ParentId);// get history by Ticket ID txtTicket.Text = "TICKET #" + data.parentTicket.id; uc = new CustomControls.UC_Chat_User(); uc.DataContext = data.parentTicket; stpn_ChatPanel.Children.Add(uc);// Chat initiated by user if (data.parentTicket.resolution != null)//if Some resolution sent by Mobikwik { //ucM = new UserControl.UC_Chat_Mobikwik(); //ucM.DataContext = data.comment; //stpn_ChatPanel.Children.Add(ucM); ucM = new CustomControls.UC_Chat_Mobikwik(); Model.Model_Chat ch = new Model.Model_Chat(); ch.Text = data.parentTicket.resolution; ch.ChatTime = data.parentTicket.resDate; ucM.DataContext = ch; stpn_ChatPanel.Children.Add(ucM); Last_CommentByMobikwik = true; } if (data.comment != null)// Ticket ReOpened { for (int i = 0; i < data.comment.Count; i++) { uc = new CustomControls.UC_Chat_User(); uc.DataContext = data.comment[i]; stpn_ChatPanel.Children.Add(uc);// Added Reopened Ticket Issue Last_CommentByMobikwik = false; if (data.comment[i].resolved == true || data.comment[i].resolution != null)// some solution sent by Mobikwik { ucM = new CustomControls.UC_Chat_Mobikwik(); Model.Model_Chat ch = new Model.Model_Chat(); ch.Text = data.comment[i].resolution; ch.ChatTime = data.comment[i].resDate; ucM.DataContext = ch; stpn_ChatPanel.Children.Add(ucM); Last_CommentByMobikwik = true; } } } ///There could be a scenerio where Mobikwik asks User some question,although this is rare.In Such case Last response is by Mobikwik but Ticket.resolution=false if (data.parentTicket.resolved == false & Last_CommentByMobikwik == false)//Ticket not resolved and Last Chat is not by Mobikwik, then show static data GetMobikwikStaticRespone(DateTime.Now); ////-------------------------------------------------- UC_Query = new CustomControls.UC_QueryMore(); if (data.parentTicket.resolved) UC_Query.DataContext = 2; else UC_Query.DataContext = 1; stpnQueryMore.Children.Add(UC_Query); GetMoreQurery(); } catch (Exception ex) { //List<Parameter> Params = new List<Parameter>(); //Params.Add(AccountFunctions.createParameter("Location", "Faq Chat")); //Params.Add(AccountFunctions.createParameter("Method", "GetChatByParentTicket, Error:" + ex.Message)); //FlurryWP8SDK.Api.LogEvent("FAQ Exception", Params); } }