예제 #1
0
        public ActionResult ScriptPreview(List <AV_ScriptPreview> data, string value2, string value3, string value4, string Head)
        {
            if (1 > 0)
            {
                AV_SiteConfigurationsBL      site   = new AV_SiteConfigurationsBL();
                List <AV_SiteConfigurations> result = new List <AV_SiteConfigurations>();
                var value = "";
                if (data != null)
                {
                    foreach (var tm in data)
                    {
                        value = value + tm.Col + ',';
                        Head  = Head + tm.Heads + ",";
                    }
                    ViewBag.TestTitles = Head;
                    result             = site.ToList("GET_SCRIPT_SETTINGS", value, value2, value3, value4).Where(m => m.KpiValue == "15").ToList();
                    //foreach(var item in rec)
                    //   {
                    //       var aa = data.Where(x => x.Col == item.TestId.ToString()).FirstOrDefault();
                    //       if (aa != null)
                    //       {
                    //              HeadTest = Head.Split(',').FirstOrDefault();
                    //               item.TestCategory = HeadTest;
                    //               var obj = Head.Split(',').Skip(1);
                    //               Head= string.Join(",", obj);

                    //               result.Add(item);

                    //       }
                    //       else
                    //       {
                    //           aa = data.Where(x => x.Col == item.TestTypeId.ToString()).FirstOrDefault();
                    //           if (aa != null)
                    //           {
                    //                   HeadTest = Head.Split(',').FirstOrDefault();
                    //                   item.TestCategory = HeadTest;
                    //                //   item.TestCategory = aa.Heads;
                    //                  result.Add(item);
                    //                  // data.Remove(aa);
                    //           }
                    //       }

                    //   }
                }
                else
                {
                    result = site.ToList("GET_SCRIPT_SETTINGS", value, value2, value3, value4).Where(m => m.KpiValue == "15").ToList();
                }
                //      AD_DefinationBL db = new AD_DefinationBL();
                //    var rec = db.ToList("GetSettings", value).Where(m=>m.DefinationTypeId==15).ToList();

                return(PartialView("~/views/NetLayerStatus/_ScriptPreview.cshtml", result.OrderBy(x => x.SortOrder)));
            }
            return(null);
        }
예제 #2
0
        public ActionResult Site(int SiteId, int NetworkModeId, int BandId)
        {
            AV_SiteConfigurationsBL site = new AV_SiteConfigurationsBL();
            var SiteData = site.ToList("GET_Configuration", SiteId.ToString(), NetworkModeId.ToString(), BandId.ToString());

            if (SiteData != null && SiteData.Count > 0)
            {
                ViewBag.Values = SiteData;
                ViewBag.SiteId = SiteId;
                var Single = SiteData.FirstOrDefault();
                if (Single != null)
                {
                    ViewBag.ClientId = Single.ClientId;
                    ViewBag.CityId   = Single.CityId;

                    ViewBag.RevisionId = (Single.SiteId > 0) ? Single.RevisionId + 1 : 1;
                    AV_GetSettingTemplateBL temp = new AV_GetSettingTemplateBL();
                    var Templates = temp.ToList("Template");
                    TempData["Templates"] = Templates;
                    ViewBag.TestCategory  = Templates.GroupBy(test => test.TestCateoryID)
                                            .Select(grp => grp.First())
                                            .ToList();

                    ViewBag.GetTestTypes = new Func <int, List <AV_GetSettingTemplate> >(GetTestTypes);
                    ViewBag.GetKpi       = new Func <int, List <AV_GetSettingTemplate> >(GetKpi);


                    ViewBag.NetworkModeId = NetworkModeId;
                    ViewBag.BandId        = BandId;
                }
                else
                {
                    TempData["msg_error"] = "Site Record Not Found";
                }
            }
            else
            {
                TempData["msg_error"] = "Site Record Not Found";
            }



            return(View());
        }