private void SetLeftPanel(string role) { string currenturl = Request.Url.ToString(); int startpoint = currenturl.IndexOf("App"); if (startpoint == 0) { startpoint = currenturl.IndexOf("app"); } int endpoint = currenturl.IndexOf("aspx"); int length = (currenturl.Length - 1) - (startpoint + 3); string url = currenturl.Substring(startpoint + 4, length); //UserService service = new UserService(); // remove user service DataTable dtLinks = new DataTable(); dtLinks.Columns.Add("Name"); dtLinks.Columns.Add("TargetURL"); dtLinks.Rows.Add("Home", "Dashboard.aspx"); dtLinks.Rows.Add("Create New Campaign", "CreateNewCampaign.aspx"); dtLinks.Rows.Add("Manage Campaign", "ViewCampaigns.aspx"); dtLinks.Rows.Add("Create New Advocate", "AddNewAffiliate.aspx"); dtLinks.Rows.Add("Manage Advocate", "ViewAffiliate.aspx"); dtLinks.Rows.Add("Create Marketing Material", "MarketingMaterial.aspx"); dtLinks.Rows.Add("Manage Marketing Material", "ViewMarketingMaterial.aspx"); Ucleftpanel1.SetLinks(dtLinks); }
private void SetLeftPanel(OrganizationRoleUserModel orgUser) { string currenturl = Request.Url.ToString(); int startpoint = currenturl.IndexOf("App"); if (startpoint == 0) { startpoint = currenturl.IndexOf("app"); } int endpoint = currenturl.IndexOf("aspx"); int length = endpoint - startpoint; string url = currenturl.Substring(startpoint + 4, length); //var listModule = null;// userdal.GetLeftPanelLinks(url, role.ToString()); EModule[] objModule = null; //if (listModule != null) objModule = listModule.ToArray(); string links = string.Empty; DataTable dtLinks = new DataTable(); dtLinks.Columns.Add("Name"); dtLinks.Columns.Add("TargetURL"); if (objModule != null && objModule.Length > 0) { for (int icount = 0; icount < objModule.Length; icount++) { dtLinks.Rows.Add(objModule[icount].Name, this.ResolveUrl(objModule[icount].TargetURL)); } } else { if (orgUser.CheckRole((long)Roles.SalesRep)) { currenturl = this.ResolveUrl("/App/Franchisee/SalesRep/Dashboard.aspx"); } else if (orgUser.CheckRole((long)Roles.FranchiseeAdmin)) { currenturl = this.ResolveUrl("/App/Franchisee/Dashboard.aspx"); } else if (orgUser.CheckRole((long)Roles.FranchisorAdmin)) { currenturl = this.ResolveUrl("/App/Franchisor/Dashboard.aspx"); } dtLinks.Rows.Add("Home", currenturl); } Ucleftpanel1.SetLinks(dtLinks); UcleftCalendar.SetLinks(dtLinks); }
private void SetLeftPanel(string role) { string currenturl = Request.Url.ToString(); int startpoint = currenturl.IndexOf("App"); if (startpoint == 0) { startpoint = currenturl.IndexOf("app"); } int endpoint = currenturl.IndexOf("aspx"); int length = (currenturl.Length - 1) - (startpoint + 3); string url = currenturl.Substring(startpoint + 4, length); //UserService service = new UserService(); // remove user service List <EModule> objModule = null; //userdal.GetLeftPanelLinks(url, role); //EModule[] objModule = service.GetLeftPanelLinks(url, role); string links = string.Empty; DataTable dtLinks = new DataTable(); dtLinks.Columns.Add("Name"); dtLinks.Columns.Add("TargetURL"); if (objModule != null && objModule.Count > 0) { for (int icount = 0; icount < objModule.Count; icount++) { dtLinks.Rows.Add(objModule[icount].Name, this.ResolveUrl(objModule[icount].TargetURL)); //links = links + "<a href=" + objModule[icount].TargetURL + ">" + objModule[icount].Name + "</a><br>"; } } else { dtLinks.Rows.Add("Home", currenturl); } //dtLinks.Rows.Add("Home", "Dashboard.aspx"); //dtLinks.Rows.Add("Create New Campaign", "CreateNewCampaign.aspx"); //dtLinks.Rows.Add("Manage Campaign", "ViewCampaigns.aspx"); //dtLinks.Rows.Add("Create New Advocate", "AddNewAffiliate.aspx"); //dtLinks.Rows.Add("Manage Advocate", "ViewAffiliate.aspx"); //dtLinks.Rows.Add("Create Marketing Material", "MarketingMaterial.aspx"); //dtLinks.Rows.Add("Manage Marketing Material", "ViewMarketingMaterial.aspx"); Ucleftpanel1.SetLinks(dtLinks); }
private void SetLeftPanel(string role) { string currenturl = Request.Url.ToString(); int startpoint = currenturl.IndexOf("App"); if (startpoint == 0) { startpoint = currenturl.IndexOf("app"); } int endpoint = currenturl.IndexOf("aspx"); int length = (currenturl.Length - 1) - (startpoint + 3); string url = currenturl.Substring(startpoint + 4, length); //UserService service = new UserService(); // remove user service List <Falcon.Entity.Other.EModule> objModule = null; // userdal.GetLeftPanelLinks(url, role); //string links = string.Empty; DataTable dtLinks = new DataTable(); dtLinks.Columns.Add("Name"); dtLinks.Columns.Add("TargetURL"); if (objModule != null && objModule.Count > 0) { for (int icount = 0; icount < objModule.Count; icount++) { dtLinks.Rows.Add(objModule[icount].Name, this.ResolveUrl(objModule[icount].TargetURL)); //links = links + "<a href=" + objModule[icount].TargetURL + ">" + objModule[icount].Name + "</a><br>"; } } else { dtLinks.Rows.Add("Home", currenturl); } Ucleftpanel1.SetLinks(dtLinks); }
private void SetRecentVisited(string role) { string currenturl = Request.Url.ToString(); string pagename = this.Page.Title; DataTable dtVisit = new DataTable(); dtVisit.Columns.Add("Name"); dtVisit.Columns.Add("TargetURL"); dtVisit.Columns.Add("Role"); if (Session["RecentVisited"] != null) { //string [,] recent=new string[5][5]; DataTable dtRecent = (DataTable)Session["RecentVisited"]; dtRecent.DefaultView.RowFilter = "TargetURL ='" + currenturl + "'"; if (dtRecent.DefaultView.Count > 0) { dtRecent.DefaultView.RowFilter = ""; DataTable dt = dtRecent; //(DataTable)Session["RecentVisited"]; Ucleftpanel1.SetRecent(dt); return; } else { string[,] recent = new string[6, 3]; int count; count = dtRecent.Rows.Count > 4 ? 4 : dtRecent.Rows.Count; recent[0, 0] = pagename; recent[0, 1] = currenturl; recent[0, 2] = role; for (int i = 1; i <= count; i++) { recent[i, 0] = dtRecent.Rows[i - 1]["Name"].ToString(); recent[i, 1] = dtRecent.Rows[i - 1]["TargetURL"].ToString(); recent[i, 2] = dtRecent.Rows[i - 1]["Role"].ToString(); } int arraycount = recent.Length / 3; for (int j = 0; j < arraycount; j++) { if (recent[j, 0] != null && recent[j, 0].Length > 0) { dtVisit.Rows.Add(recent[j, 0], recent[j, 1], recent[j, 2]); } } dtVisit.DefaultView.RowFilter = "Role='" + role + "'"; dtVisit = dtVisit.DefaultView.ToTable(); if (dtVisit.Rows.Count > 0) { Session["RecentVisited"] = dtVisit; } else { dtVisit.Rows.Add(pagename, currenturl, role); Session["RecentVisited"] = dtVisit; } Ucleftpanel1.SetRecent(dtVisit); } } else { dtVisit.Rows.Add(pagename, currenturl, role); Session["RecentVisited"] = dtVisit; Ucleftpanel1.SetRecent(dtVisit); } }
private void GetCallDetails(long intCCUserID) { CallCenterDAL objCCRepDAL = new CallCenterDAL(); List <ECall> objCalls = objCCRepDAL.GetCalls(intCCUserID, 1); string totalCall; string averageCall; string maxCall; string minCall; string Recent1 = "-N/A-"; string Recent2 = "-N/A-"; if (objCalls != null && objCalls.Count > 0) { int hours = 0; int min = 0; int sec = 0; int TotalTime = 0; int totalHrs = 0; int totalMin = 0; int totalSec = 0; int avgMin = 0; int avghr = 0; int avgSec = 0; TimeSpan MinDuartion = new TimeSpan(); TimeSpan MaxDuartion = new TimeSpan(); TimeSpan callDuration = new TimeSpan(); totalCall = objCalls[0].TotalCalls.ToString(); string status = objCalls[0].CallStatus.Length > 0 ? objCalls[0].CallStatus : "Interupted"; Recent1 = "Call for " + status + " on " + Convert.ToDateTime(objCalls[0].DateCreated).ToShortDateString() + " at " + Convert.ToDateTime(objCalls[0].DateCreated).ToShortTimeString(); if (objCalls.Count > 1) { status = objCalls[1].CallStatus.Length > 0 ? objCalls[1].CallStatus : "Interupted"; Recent2 = "Call for " + status + " on " + Convert.ToDateTime(objCalls[1].DateCreated).ToShortDateString() + " at " + Convert.ToDateTime(objCalls[1].DateCreated).ToShortTimeString(); } for (int i = 0; i < objCalls.Count; i++) { callDuration = Convert.ToDateTime(objCalls[i].TimeEnd).Subtract(Convert.ToDateTime(objCalls[i].TimeCreated)); hours = hours + Convert.ToInt32(callDuration.Hours.ToString()); min = min + Convert.ToInt32(callDuration.Minutes.ToString()); sec = sec + Convert.ToInt32(callDuration.Seconds.ToString()); if (callDuration > MaxDuartion) { MaxDuartion = callDuration; } if (i == 0) { MinDuartion = callDuration; } if (callDuration < MinDuartion) { MinDuartion = callDuration; } } TotalTime = (hours * 3600) + (min * 60) + sec; totalHrs = TotalTime / 3600; totalMin = (TotalTime % 3600) / 60; totalSec = (TotalTime % 3600) % 60; TotalTime = TotalTime / objCalls.Count; avghr = TotalTime / 3600; avgMin = (TotalTime % 3600) / 60; avgSec = (TotalTime % 3600) % 60; if (avghr > 0) { averageCall = avghr + "." + avgMin + "." + avgSec + "H"; } else { averageCall = avgMin + "." + avgSec + "M"; } if (Convert.ToInt32(MaxDuartion.Hours.ToString()) > 0) { maxCall = MaxDuartion.Hours.ToString() + "." + MaxDuartion.Minutes.ToString() + "." + MaxDuartion.Seconds.ToString() + "H"; } else { maxCall = MaxDuartion.Minutes.ToString() + "." + MaxDuartion.Seconds.ToString() + "M"; } if (Convert.ToInt32(MinDuartion.Hours.ToString()) > 0) { minCall = MinDuartion.Hours.ToString() + "." + MinDuartion.Minutes.ToString() + "." + MinDuartion.Seconds.ToString() + "H"; } else { minCall = MinDuartion.Minutes.ToString() + "." + MinDuartion.Seconds.ToString() + "M"; } } else { averageCall = "-N/A-"; totalCall = "-N/A-"; minCall = "-N/A-"; maxCall = "-N/A-"; } Ucleftpanel1.SetDetails(totalCall, averageCall, maxCall, minCall); Ucleftpanel1.SetRecentCalls(Recent1, Recent2); }