public ActionResult TranferLogs(Int64 Id) { SitesBL sb = new SitesBL(); List <BandVM> Bands = sb.GetSiteBands("", Id); ViewBag.Bands = Bands.Select(m => new { m.BandId, m.NetworkMode, m.LayerStatusId, m.BandName, m.Carrier, Text = m.NetworkMode + " " + m.BandName + " " + m.Carrier, Value = m.SiteCode + "_" + m.NetworkMode + "_" + m.BandName + "_" + m.Carrier }).ToList(); AV_SectorBL secb = new AV_SectorBL(); ViewBag.Sectors = secb.ToList("BySiteId", Id.ToString(), "0", "0", "0", "0").GroupBy(m => m.SectorCode).Select(grp => grp.First()).ToList(); AD_DefinationBL db = new AD_DefinationBL(); ViewBag.Tests = db.SelectedList("byDefinationType", "Test Type", null); AV_TestDL t = new AV_TestDL(); // ViewBag.count = t.CountTestsofsite("Count_Testslogs", Id, 0,"","","",""); ViewBag.count = null; ViewBag.Tasks = new List <SelectListItem>() { new SelectListItem { Value = "Summary", Text = "Summary" }, new SelectListItem { Value = "Logs", Text = "Logs" }, new SelectListItem { Value = "Files", Text = "Files" } }; ViewBag.SiteId = Id; return(View()); }
public ActionResult LayerActivation(Int64 SiteId) { SitesBL sl = new SitesBL(); var rec = sl.GetSiteBands("Get_All", SiteId); AV_SectorBL secb = new AV_SectorBL(); ViewBag.SiteId = SiteId; ViewBag.Sectors = secb.ToList("BySiteId", SiteId.ToString(), null, null, null, null); return(PartialView("~/views/NetLayerStatus/_LayerActivation.cshtml", rec)); }
public ActionResult Information(Int64 Id) { ViewBag.SiteId = Id; List <string> Chennels = new List <string>(); List <string> TestTypes = new List <string>(); List <GetDirctoryinformation> singdir = new List <GetDirctoryinformation>(); SitesBL sb = new SitesBL(); try { List <BandVM> Bands = sb.GetSiteBands("", Id); if (Bands.Count > 0) { AV_SectorBL secb = new AV_SectorBL(); ViewBag.Sectors = secb.ToList("GetSectors", Id.ToString(), null, null, null, null); ViewBag.Bands = Bands.Select(m => new { m.BandId, m.NetworkMode, m.BandName, m.Carrier, Text = m.NetworkMode + " " + m.BandName + " " + m.Carrier, Value = m.SiteCode + "_" + m.NetworkMode + "_" + m.BandName + "_" + m.Carrier }).ToList(); ViewBag.NetworkModeBag = Bands; var band = Bands.FirstOrDefault(); var sPath = Server.MapPath("~/Content/AirViewLogs/" + band.ClientPrefix + "\\" + band.SiteCode); ViewBag.FilePath = sPath; if (Directory.Exists(sPath)) { FileInfo[] allFiles = new DirectoryInfo(sPath).GetFiles("*.xml", SearchOption.AllDirectories); if (allFiles.Length > 0) { foreach (var file in allFiles) { GetDirctoryinformation info = new GetDirctoryinformation(); info.createDate = file.CreationTime.ToString(); info.directoryPath = file.FullName; info.fileName = file.Name; info.fileType = file.Extension; info.size = (file.Length / 1024).ToString(); singdir.Add(info); } } var fileList = new DirectoryInfo(sPath).GetFiles("*.xml", SearchOption.AllDirectories); myFile mf = new myFile(); for (int i = 0; i < fileList.Length; i++) { try { XmlDocument doc = new XmlDocument(); doc.Load(fileList[i].FullName); string jsonText = JsonConvert.SerializeXmlNode(doc); JObject json = JObject.Parse(jsonText); //string txt = mf.FileToString(fileList[i].FullName); //JObject json = JObject.Parse(txt); string rssTitle = (string)json["Drive"]["TestType"]; foreach (var x in json) { // string name = x.Key; JToken value = x.Value; if (value != null) { var sector = value["TestType"]; TestTypes.Add(sector.ToString()); } } var Chennellst = from p in json["Drive"]["message-body"] select new { channel = (string)p["channel"], Event = (string)p["event"] }; foreach (var item in Chennellst) { Chennels.Add(item.channel); } } catch (Exception ex) { } } } } } catch (Exception) { //throw; } ViewBag.AVXFiles = singdir.ToList(); ViewBag.Chennels = Chennels.Distinct().ToList(); ViewBag.TestTypes = TestTypes.Distinct().ToList(); return(View()); }