Esempio n. 1
0
        public ActionResult Explorer()
        {
            TabDetailModel tabDetail = getTabDetails();

            ViewBag.TabHeaderHtml          = tabDetail.tabHeaderHtml;
            ViewBag.TabContentHtml         = tabDetail.tabContentHtml;
            ViewBag.TabNodes               = tabDetail.tabnodes;
            ViewBag.TreeViewPLMNObjectData = GetPLMNObjectData();
            ViewBag.ReportExcelDatajson    = JsonConvert.SerializeObject(new List <Report_ExcelData>());

            ConfigParamModel model = new ConfigParamModel();

            model.FromDate = DateTime.Now.AddDays(-7);
            model.ToDate   = DateTime.Now;

            return(View(model));
        }
Esempio n. 2
0
        public ActionResult Calculate(ConfigParamModel form, FormCollection formData)
        {
            ConfigParamModel model = new ConfigParamModel();

            if (form.ReportType.ToLower() == "geo")
            {
                model.GeoReportData = CalculateGeoReports(form, formData);
            }
            else if (form.ReportType.ToLower() == "reports")
            {
                model.ReportExcelData = CalculateReports(form, formData);
            }
            else
            {
                model.GeoReportData = GetReportTemplate(form, formData);
            }

            //return View();
            //return null;

            //return new EmptyResult();
            //return File(Encoding.UTF8.GetBytes(sb.ToString()), "text/csv", "Ericsson.csv");
            //return File(@"D:\weekly_reports\$2020_$06_$03_Cluster daily.ttr", "text/plain");
            //return File(@"D:\weekly_reports\2020_05_26_Cluster daily.ttr", "text/plain", "ClusterReport.ttr");

            //return File(@"D:\weekly_reports\2020_05_26_Cluster daily.ttr", "text/plain", "ClusterReport.ttr");

            TabDetailModel tabDetail = getTabDetails();

            ViewBag.TabHeaderHtml          = tabDetail.tabHeaderHtml;
            ViewBag.TabContentHtml         = tabDetail.tabContentHtml;
            ViewBag.TabNodes               = tabDetail.tabnodes;
            ViewBag.TreeViewPLMNObjectData = GetPLMNObjectData();

            model.FromDate = DateTime.Now.AddDays(-7);
            model.ToDate   = DateTime.Now;

            return(View("Explorer", model));
            //return File("D:\\weekly_reports\\tmp.txt", "text/plain");

            //return new HttpStatusCodeResult(204);
        }
        public TabDetailModel GetMeetingInfoTabDetils(int meetingID, int tabIDs = 1)
        {
            using (meetingContext = new OCASIAMeetingContext())
            {
                TabDetailModel model = meetingContext.RegistrationTabDetails.Where(el => el.IsActive && el.MeetingID == meetingID && el.RegistrationTabID == tabIDs).
                                       Select(el => new TabDetailModel()
                {
                    RegistrationTabID       = el.RegistrationTabID,
                    MeetingID               = el.MeetingID,
                    BasicDescription        = el.BasicDescription,
                    Description1            = el.Description1,
                    Description1PicturePath = el.Description1PicturePath,
                    Description2            = el.Description2,
                    Description2PicturePath = el.Description2PicturePath,
                    Description3            = el.Description3,
                    Description3PicturePath = el.Description3PicturePath,
                    Description4            = el.Description4,
                    Description4PicturePath = el.Description4PicturePath
                    ,
                    FileName1     = el.FileName1,
                    FileName1Path = el.FileName1Path,
                    FileName2     = el.FileName2,
                    FileName2Path = el.FileName2Path,
                    FileName3     = el.FileName3,
                    FileName3Path = el.FileName3Path,
                    FileName4     = el.FileName4,
                    FileName4Path = el.FileName4Path
                }).FirstOrDefault();
                if (model == null)
                {
                    return(new TabDetailModel());
                }
#if DEBUG
                model.Description1PicturePath = model.Description2PicturePath = model.Description3PicturePath = model.Description4PicturePath = "../Content/banners.jpg";
                model.FileName1Path           = model.FileName2Path = model.FileName3Path = model.FileName4Path = "../Content/banners.jpg";
#else
#endif
                return(model);
            }
        }
Esempio n. 4
0
        private TabDetailModel getTabDetails()
        {
            TabDetailModel tabDetailModel = new TabDetailModel();

            string tabHeaderHtml         = string.Empty;
            string tabContentHtml        = string.Empty;
            List <TreeViewNode> tabnodes = null;
            DBHelper            db       = new DBHelper();

            //List<TreeViewNode> lstIFSData = db.GetIFSData();
            lstIFSData = db.GetIFSData();

            //foreach (TreeViewNode item in lstIFSData.Where(x => x.parentid == "0" && x.text == "PublicFolders"))
            //{
            //    List<TreeViewNode> nodes = getIFSChildNodes(item.id, "/" + item.text);

            //    //treeNode.nodes.Add(node);
            //}

            IFSDataModel node = lstIFSData.FirstOrDefault(x => x.parentid == "0" && x.text == "PublicFolders");

            if (node != null && !string.IsNullOrEmpty(node.id))
            {
                tabnodes = getIFSChildNodes(node.id, "/" + node.text);

                foreach (TreeViewNode item in tabnodes)
                {
                    if (tabnodes.IndexOf(item) == 0)
                    {
                        tabHeaderHtml  += @"<li class=""active""><a data-toggle=""tab"" href=""#" + item.text.ToLower() + @""">" + item.text + "</a></li>";
                        tabContentHtml += @"<div id=""" + item.text.ToLower() + @""" class=""tab-pane fade in active"">"
                                          + @"<div id=""treeview" + item.text.ToLower() + @""" class=""treeview""></div>"
                                          + "</div>";
                    }
                    else
                    {
                        tabHeaderHtml  += @"<li><a data-toggle=""tab"" href=""#" + item.text.ToLower() + @""">" + item.text + "</a></li>";
                        tabContentHtml += @"<div id=""" + item.text.ToLower() + @""" class=""tab-pane fade"">"
                                          + @"<div id=""treeview" + item.text.ToLower() + @""" class=""treeview""></div>"
                                          + "</div>";
                    }
                }
            }

            //List<TreeViewNode> treeNodelist = new List<TreeViewNode>();
            //treeNodelist.Add(treeNode);

            //string treeViewDatajson = JsonConvert.SerializeObject(treeNodelist);
            //ViewBag.TreeViewData = treeViewDatajson;

            //    tabHeaderHtml = @"<li class=""active""><a data-toggle=""tab"" href=""#geo"">Geo</a></li>"
            //+ @"<li><a data-toggle=""tab"" href=""#report"">Report</a></li>";
            //    tabContentHtml = @"<div id=""geo"" class=""tab-pane fade in active"">"
            //    + "<h3>Geo</h3>"
            //    + "<p>Geo Tree structure</p>"
            //+ "</div>"
            //+ @"<div id=""report"" class=""tab-pane fade"">"
            //    + "<h3>Report</h3>"
            //    + "<p>Report Tree structure</p>"
            //+ "</div>";
            tabDetailModel.tabHeaderHtml  = JsonConvert.SerializeObject(tabHeaderHtml);
            tabDetailModel.tabContentHtml = JsonConvert.SerializeObject(tabContentHtml);
            tabDetailModel.tabnodes       = JsonConvert.SerializeObject(tabnodes);

            return(tabDetailModel);
        }