private void GetMobikwikStaticRespone(DateTime dateTime) { chatObject = new Model.Model_Chat(); CustomControls.UC_Chat_Mobikwik ucM = new CustomControls.UC_Chat_Mobikwik(); chatObject.Text = "We are looking into the issue."; // chatObject.ChatTime = String.Format("{0:dd MMM, yyyy HH:mm}", System.DateTime.Now);//String.Format("{0:f}", dateTime); // "Sunday, March 9, 2008" chatObject.ChatTime = String.Format("{0:MMM dd, yyyy h:mm:ss tt}", System.DateTime.Now); ucM.DataContext = chatObject; stpn_ChatPanel.Children.Add(ucM); // GetMoreQurery(); }
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); } }