// GET: TemplateSetting public ActionResult TestSetting() { SelectedList sl = new SelectedList(); UserClientsBL ucb = new UserClientsBL(); ViewBag.UserClients = ucb.SelectedList("byUserId", Convert.ToString(ViewBag.UserId)); AD_DefinationBL db = new AD_DefinationBL(); if (ViewBag.IsAdmin) { ViewBag.Cities = db.SelectedList("AllCities"); } else { ViewBag.Cities = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId)); } // ViewBag.Cities = sl.Cities(); ViewBag.NetworkModes = db.SelectedList("NetworkModes", null, "-Select NetworkMode-"); //ViewBag.NetworkModes = sl.NetworkModes(); ViewBag.Bands = db.ToList("Bands"); ViewBag.Carriers = db.ToList("Carriers"); return(View()); }
public ActionResult Scanner(int SiteId, int NetworkModeId, int BandId) { SelectedList sl = new SelectedList(); UserClientsBL ucb = new UserClientsBL(); ViewBag.UserClients = ucb.SelectedList("byUserId", Convert.ToString(ViewBag.UserId)); AD_DefinationBL db = new AD_DefinationBL(); if (ViewBag.IsAdmin) { ViewBag.Cities = db.SelectedList("AllCities"); } else { ViewBag.Cities = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId)); } ViewBag.Manufacturer = db.SelectedList("byDefinationType", "ScannerManufacturer", "-Select Manufacturer-"); ViewBag.ScannerModel = db.ToList("byDefinationType", "ScannerModel"); ViewBag.ScannerProtocol = db.SelectedList("byDefinationType", "Scanner Protocol", "-Select Protocol-"); ViewBag.ScannerBand = db.ToList("byDefinationType", "Scanner Band"); AV_SiteScannerConfigurationsBL site = new AV_SiteScannerConfigurationsBL(); var SiteData = site.ToList("GET_SiteParams", SiteId.ToString(), NetworkModeId.ToString(), BandId.ToString(), ""); if (SiteData != null && SiteData.Count > 0) { var Single = SiteData.FirstOrDefault(); if (Single != null) { ViewBag.ClientId = Single.ClientId; ViewBag.CityId = Single.CityId; } } ViewBag.SiteId = SiteId; ViewBag.NetworkModeId = NetworkModeId; ViewBag.BandId = BandId; //ViewBag.IsExist = false; //var siteConfig = site.ToList("GET_Configuration", SiteId.ToString(), NetworkModeId.ToString(), BandId.ToString()); //if (siteConfig.Count()>0) //{ // ViewBag.IsExist = true; // ViewBag.Values = siteConfig; // TempData["Templates"] = siteConfig; // ViewBag.TestCategory = siteConfig.GroupBy(test => test.TestCatogoryId) // .Select(grp => grp.First()) // .ToList(); // ViewBag.GetTestTypes = new Func<int, List<AV_GetScannerSettingTemplate>>(GetScannerTestTypes); // ViewBag.GetKpi = new Func<int, List<AV_GetScannerSettingTemplate>>(GetScannerKpi); //} return(View()); }
public ActionResult ScannerSetting() { SelectedList sl = new SelectedList(); UserClientsBL ucb = new UserClientsBL(); ViewBag.UserClients = ucb.SelectedList("byUserId", Convert.ToString(ViewBag.UserId)); AD_DefinationBL db = new AD_DefinationBL(); if (ViewBag.IsAdmin) { ViewBag.Cities = db.SelectedList("AllCities"); } else { ViewBag.Cities = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId)); } ViewBag.Manufacturer = db.SelectedList("byDefinationType", "ScannerManufacturer", "-Select Manufacturer-"); ViewBag.ScannerModel = db.ToList("byDefinationType", "ScannerModel"); ViewBag.ScannerProtocol = db.SelectedList("byDefinationType", "Scanner Protocol", "-Select Protocol-"); ViewBag.ScannerBand = db.ToList("byDefinationType", "Scanner Band"); return(View()); }
// GET: ReportConfigurations public ActionResult New(string id = "0") { SelectedList sl = new SelectedList(); UserClientsBL ucb = new UserClientsBL(); ViewBag.UserClients = ucb.SelectedList("byUserId", Convert.ToString(ViewBag.UserId)); AD_DefinationBL db = new AD_DefinationBL(); ViewBag.Cities = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId)); var ReportTypes = db.SelectedList("ReportTypes"); ViewBag.ReportTypes = ReportTypes; if (ReportTypes.Count > 0 && Convert.ToInt32(id) == 0) { id = ReportTypes.FirstOrDefault().Value; } ViewBag.SelectedReport = id; ViewBag.Scopes = db.SelectedList("byDefinationType", "Scope"); return(View()); }
// GET: Market public ActionResult Configuration(int Id = 0) { ViewBag.CityId = Id; AD_DefinationBL db = new AD_DefinationBL(); if (ViewBag.IsAdmin) { ViewBag.Cities = db.SelectedList("AllCities"); } else { ViewBag.Cities = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId)); } Sec_UserBL ubl = new Sec_UserBL(); ViewBag.Users = ubl.SelectedList("All", null); ViewBag.MarketUsers = ubl.SelectedList("ByCityId", Id.ToString()); ViewBag.NetworkModes = db.SelectedList("NetworkModes", null, "-Select NetworkMode-"); UserClientsBL ucb = new UserClientsBL(); ViewBag.UserClients = ucb.SelectedList("byUserId", Convert.ToString(ViewBag.UserId)); ViewBag.Projects = db.SelectedList("UserProjects", Convert.ToString(ViewBag.UserId)); ViewBag.ReportTypes = db.SelectedList("ReportTypes", null, "-Report Types-"); ViewBag.Scopes = db.SelectedList("byDefinationType", "Scope"); ViewBag.PlotTypes = db.SelectedList("RFPlotTypes"); return(View()); }
public ActionResult Edit(string Id = "") { ClientsBL cb = new ClientsBL(); UserClientsBL uchb = new UserClientsBL(); UserCityBL ucb = new UserCityBL(); AD_DefinationBL db = new AD_DefinationBL(); Sec_User user = new Sec_User(); Sec_UserBL ubl = new Sec_UserBL(); Sec_UserSettingsDL udl = new Sec_UserSettingsDL(); Sec_PermissionBL pl = new Sec_PermissionBL(); Sec_UserDefinationTypeBL udt = new Sec_UserDefinationTypeBL(); ViewBag.Titles = new List <SelectListItem> { new SelectListItem { Text = "Mr.", Value = "1" }, new SelectListItem { Text = "Mrs.", Value = "2" }, new SelectListItem { Text = "Miss.", Value = "3" }, new SelectListItem { Text = "Ms.", Value = "4" }, new SelectListItem { Text = "Sir.", Value = "5" }, new SelectListItem { Text = "DR", Value = "6" } }; ViewBag.Hide = false; ViewBag.Team = false; if (Id == Convert.ToString(ViewBag.UserId)) { ViewBag.Hide = true; List <OrgChart> rec = ubl.hierarchy("ByCompanyId", Convert.ToString(ViewBag.CompId)); List <Chart> Data2 = FlatToHierarchy(rec, ViewBag.UserId); if (Data2.Count > 0) { ViewBag.Team = true; } else { ViewBag.Team = false; } } SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList(); Sec_UserBL ud = new Sec_UserBL(); Sec_User User = ud.Single("ById", Id.ToString()); ViewBag.UserTitle = User.Title; ViewBag.Hide2 = true; if (User.ReportToId.ToString() == Convert.ToString(ViewBag.UserId)) { ViewBag.Hide2 = false; } if (Id == Convert.ToString(ViewBag.UserId)) { ViewBag.Hide2 = false; } ViewBag.User = User; if (User == null) { } if (User.IsAdmin == true) { ViewBag.Hide = false; ViewBag.Hide2 = false; ViewBag.Team = true; } NewData(); ViewBag.Id = User.CompanyId; ViewBag.RoleId = User.RoleId; ViewBag.Reports = sl.User("All"); ViewBag.ReportTo = ud.ToList("All"); ViewBag.Clients2 = sl.Clients("AllRecords"); /////permissions user = ubl.Single("ById", Id.ToString()); ///Project DataTable Table = udl.GetDataTable("All_Projects", User.ReportToId.ToString(), null, null); ViewBag.Projects = Table.ToList <PM_Projects>(); DataTable Table1 = udl.GetDataTable("UserProjects", Id.ToString(), null, null); ViewBag.UserProjects = Table1.ToList <PM_Projects>(); var r = pl.ToList("byUserId", Id.ToString()); var d = udt.ToList("GetByUserId", Id.ToString()); string UDSelected = null; foreach (var item in d) { UDSelected += item.DefinationTypeId + ","; } ViewBag.DIds = UDSelected; string Selected = null; foreach (var item in r) { Selected += item.Id + ","; } ViewBag.PIds = Selected; ViewBag.UId = Id; #region user Permissions on tab //Clients //ViewBag.Clients = cb.ToList("byStatus", User.ReportToId.ToString()); ViewBag.Clients = cb.ToList("byStatus", "True", User.ReportToId.ToString()); ViewBag.UserClients = uchb.ToList("byUserId", Id.ToString()); //Cities ViewBag.Cities = db.ToList("AllCities"); //db.ToList("UserCities",User.ReportToId.ToString()); ViewBag.UserCities = ucb.ToList("byUserId", Id.ToString()); ViewBag.Region = db.RegionsToList(User.ReportToId.ToString()); //scope ViewBag.Scopes = db.ToList("Scopes", User.ReportToId.ToString()); //ViewBag.Scopes = db.ToList("Scopes"); ViewBag.UserScopes = db.ToList("UserScopes", Id.ToString()); ViewBag.Permissions = pl.ToList("byRoleId", user.RoleId.ToString(), User.ReportToId.ToString()); #endregion AD_DefinationTypesBL dtd = new AD_DefinationTypesBL(); ViewBag.DefinationTypes = dtd.ToList("All", User.ReportToId.ToString()); //User.RoleName = ViewBag.RoleName; return(View("edit", User)); }
public ActionResult ByUser(int id = 0) { Sec_User user = new Sec_User(); Sec_UserBL ubl = new Sec_UserBL(); user = ubl.Single("ById", id.ToString()); if (user != null) { Sec_UserSettingsDL udl = new Sec_UserSettingsDL(); Sec_PermissionBL pl = new Sec_PermissionBL(); Sec_UserDefinationTypeBL ud = new Sec_UserDefinationTypeBL(); ///Projects and User projects DataTable Table = udl.GetDataTable("All_Projects", null, null, null); ViewBag.Projects = Table.ToList <PM_Projects>(); DataTable Table1 = udl.GetDataTable("UserProjects", id.ToString(), null, null); ViewBag.UserProjects = Table1.ToList <PM_Projects>(); var r = pl.ToList("byUserId", id.ToString()); var d = ud.ToList("GetByUserId", id.ToString()); string UDSelected = null; foreach (var item in d) { UDSelected += item.DefinationTypeId + ","; } ViewBag.DIds = UDSelected; string Selected = null; foreach (var item in r) { Selected += item.Id + ","; } ViewBag.PIds = Selected; ViewBag.UId = id; // User Clients ClientsBL cb = new ClientsBL(); ViewBag.Clients = cb.ToList("byStatus", "True"); // get selected user Clients UserClientsBL uchb = new UserClientsBL(); ViewBag.UserClients = uchb.ToList("byUserId", id.ToString()); // get selected user Cities UserCityBL ucb = new UserCityBL(); ViewBag.UserCities = ucb.ToList("byUserId", id.ToString()); // get Regions AD_DefinationBL db = new AD_DefinationBL(); ViewBag.Region = db.RegionsToList(); ViewBag.Cities = db.ToList("AllCities"); ViewBag.Scopes = db.ToList("Scopes"); ViewBag.UserScopes = db.ToList("UserScopes", id.ToString()); // ViewBag.UserScopes = string.Join(",", Scopes.Select(n => n.DefinationId.ToString()).ToArray()); var Permissions = pl.ToList("byRoleId", user.RoleId.ToString()); return(View(Permissions)); } else { TempData["msg_error"] = "User not Found."; } return(View()); }