// 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());
        }
示例#3
0
        public ActionResult Movement()
        {
            string TransType = "";

            if (Request.QueryString["UEId"] != null)
            {
                ViewBag.UEId = Convert.ToInt32(Request.QueryString["UEId"]);
            }

            if (Request.QueryString["UserId"] != null)
            {
                ViewBag.UserId = Request.QueryString["UserId"];
            }

            if (Request.QueryString["UETypeId"] != null)
            {
                ViewBag.UETypeId = Request.QueryString["UETypeId"];
            }


            if (Request.QueryString["UEsts"] != null)
            {
                TransType = Request.QueryString["UEsts"];
            }

            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.UEStatus = db.SelectedList("byDefinationType", "UE Status", "-Transaction Type-");

            foreach (var v in ViewBag.UEStatus)
            {
                if (v.Text == TransType)
                {
                    ViewBag.UEsts = v.Value;
                }
            }

            ViewBag.UETypes = db.SelectedList("byDefinationType", "UE Type", "-select-");

            AD_UserEquipmentsBL ueb = new AD_UserEquipmentsBL();

            ViewBag.Equipments = ueb.SelectedList("All", "", "-select-");

            Sec_UserBL ub = new Sec_UserBL();

            ViewBag.Users = ub.SelectedList("ByStatus", true.ToString(), "-Users-");

            ViewBag.IssueToUsers = ub.SelectedList("ByStatus", true.ToString(), "-Users-");

            return(View());
        }
示例#4
0
        public ActionResult TranferLogs(Int64 SiteLayerId, Int64[] Sectors, string[] Tests, string[] Tasks, string SiteCode, int SiteId)
        {
            Response res = new Response();

            try
            {
                TransferSiteLogsDL tsd = new TransferSiteLogsDL();
                AV_SiteTestLogBL   st  = new AV_SiteTestLogBL();
                var             Sector = string.Join(",", Sectors);
                AD_DefinationBL db     = new AD_DefinationBL();
                ViewBag.Tests = db.SelectedList("byDefinationType", "Test Type", null);
                var Test = string.Join(",", Tests);
                var Task = string.Join(",", Tasks);
                st.TransferSiteLogs("Transfer_Testslogs", SiteId, SiteLayerId, Sector, Test, SiteCode, Task);
                foreach (var item in Tasks)
                {
                    if (item == "Files")
                    {
                        st.ChangeFolderName(SiteLayerId, SiteCode);
                    }
                }
                res.Status  = "success";
                res.Message = "save successfully";
            }
            catch (Exception ex)
            {
                res.Status  = "danger";
                res.Message = ex.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
示例#5
0
        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());
        }
示例#6
0
        public ActionResult New()
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.QuestionType = db.SelectedList("byDefinationType", "Question Type", "-Question Type-");
            return(PartialView("~/Areas/Survey/Views/Question/_New.cshtml"));
        }
示例#7
0
        public ActionResult UniqueMarketSiteCodes()
        {
            Common.SelectedList sl = new Common.SelectedList();

            AD_DefinationBL db = new AD_DefinationBL();

            if (ViewBag.IsAdmin)
            {
                ViewBag.ddCities = db.SelectedList("AllCities");
            }
            else
            {
                ViewBag.ddCities = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId));
            }
            //ViewBag.ddCities = sl.Cities(true);
            return(PartialView("~/views/WorkOrder/_UniqueMarketSiteCodes.cshtml"));
        }
示例#8
0
        public ActionResult Edit(int Id = 0, int ProjectSiteId = 0)
        {
            if (Id > 0)
            {
                var oob = Permission.AllowProject(Convert.ToInt64(Id));
                if (oob == null)
                {
                    TempData["msg_error"] = "This Project is not assigned to you. Please contact administrator for project assignment.";
                    return(RedirectToAction("index", "error", new { Area = "Project" }));
                }
                else
                {
                    TempData["ProjectEntity"] = oob; TempData.Keep("ProjectEntity");
                }
            }
            AD_DefinationBL    db  = new AD_DefinationBL();
            Sec_UserSettingsDL udl = new Sec_UserSettingsDL();

            ViewBag.FormType = (TempData["FormType"] != null) ? "Edit" : "New";

            ViewBag.Id = Id;

            ViewBag.Bands = db.ToList("Bands");

            ViewBag.ProjectSiteId = ProjectSiteId;
            ViewBag.ProjectSite   = ub.ToList("Get_By_Id", ProjectSiteId.ToString()).FirstOrDefault();
            if (ViewBag.ProjectSite == null)
            {
                TempData["msg_error"] = "Record Not Exist or You Are Not Authorize to access !";
                return(RedirectToAction("All"));
            }
            ViewBag.Carriers = db.ToList("Carriers");

            ViewBag.Regions = db.ToList("UserRegions", Convert.ToString(ViewBag.UserId));
            DataTable Table = udl.GetDataTable("UserProjects", Convert.ToString(ViewBag.UserId), null, null);

            ViewBag.Projects     = Table.ToList <PM_Projects>().Where(x => x.ProjectId == Id).ToList();
            ViewBag.Cities       = db.ToList("UserCities", Convert.ToString(ViewBag.UserId));
            ViewBag.SubCheckList = db.ToList("byDefinationType", "Sub CheckList");

            SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
            ViewBag.NetworkModes = db.SelectedList("NetworkModes", null, "-NetworkMode-");
            var hjh = db.MultiSelecet("NetworkModes", null, "-NetworkMode-");

            ViewBag.NetworkModesm = hjh;
            ViewBag.States        = sl.Definations("UserStates", Convert.ToString(ViewBag.UserId), "-State-"); //sl.States();
            TSS_SurveyDocumentBL sdb = new TSS_SurveyDocumentBL();

            ViewBag.Surveys     = sdb.ToList("GetAll_byIsActive", true.ToString());;
            ViewBag.Scopes      = sl.Definations("UserScopes", Convert.ToString(ViewBag.UserId));// sl.Scopes();
            ViewBag.Clients     = sl.Clients("UserClients", Convert.ToString(ViewBag.UserId));
            ViewBag.SiteTypes   = sl.Definations("SiteTypes");
            ViewBag.SiteClasses = sl.Definations("SiteClasses");
            ViewBag.CheckList   = sl.Definations("byDefinationType", "CheckList", "-CheckList-");
            ViewBag.Sectors     = sl.Sectors();
            return(View());
        }
示例#9
0
 public ActionResult GetDataTemplates(int id)
 {
     if (id != 0)
     {
         AD_DefinationBL db  = new AD_DefinationBL();
         var             res = db.SelectedList("getDataTemplates", id.ToString());
         return(Json(res, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json("", JsonRequestBehavior.AllowGet));
     }
 }
示例#10
0
        public ActionResult Edit(Int64 id)
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.UETypes = db.SelectedList("byDefinationType", "UE Type", "-select Device-");
            AD_UserEquipmentsBL ueb = new AD_UserEquipmentsBL();

            ClientsBL cBl = new ClientsBL();

            ViewBag.UEOwner = cBl.SelectedList("All", null, "-Select Owner-");

            return(View("new", ueb.ToSingle("ById", id.ToString())));
        }
示例#11
0
        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());
        }
示例#12
0
        // 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());
        }
示例#13
0
        // GET: ScopeTest
        public ActionResult New()
        {
            Common.SelectedList sl = new Common.SelectedList();
            ViewBag.Clients = sl.Clients("All");


            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(true);
            ViewBag.NetworkModes = db.SelectedList("NetworkModes", null, "-NetworkMode-");
            // ViewBag.NetworkModes = sl.NetworkModes();
            ViewBag.TestTypes = sl.Definations("byDefinationType", "Test Types", "-Select Test Type-");
            ViewBag.Scope     = sl.Definations("byDefinationType", "Scope", "-Select Scope-");
            return(View());
        }
示例#14
0
        public ActionResult New()
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.UETypes = db.SelectedList("byDefinationType", "UE Type", "-Select Device-");

            //TempData["CompanyId"] = Convert.ToString(ViewBag.CompId);
            //ViewBag.UEOwner = Convert.ToString(ViewBag.CompId);

            ClientsBL cBl = new ClientsBL();

            ViewBag.UEOwner = cBl.SelectedList("All", null, "-Select Owner-");


            return(View());
        }
示例#15
0
        public ActionResult Workorder(Int64 Id = 0)
        {
            AD_DefinationBL    db  = new AD_DefinationBL();
            Sec_UserSettingsDL udl = new Sec_UserSettingsDL();

            ViewBag.FormType = (TempData["FormType"] != null) ? "Edit" : "New";

            ViewBag.Bands = db.ToList("Bands");

            ViewBag.Id = Id;

            ViewBag.Carriers = db.ToList("Carriers");


            DataTable Table = udl.GetDataTable("UserProjects", Convert.ToString(ViewBag.UserId), null, null);

            ViewBag.Projects     = Table.ToList <PM_Projects>();
            ViewBag.Cities       = db.ToList("UserCities", Convert.ToString(ViewBag.UserId));
            ViewBag.SubCheckList = db.ToList("byDefinationType", "Sub CheckList");

            Common.SelectedList sl = new Common.SelectedList();
            ViewBag.NetworkModes = db.SelectedList("NetworkModes", null, "-NetworkMode-");
            var hjh = db.MultiSelecet("NetworkModes", null, "-NetworkMode-");

            ViewBag.NetworkModesm = hjh;
            ViewBag.States        = sl.Definations("UserStates", Convert.ToString(ViewBag.UserId), "-State-"); //sl.States();
            ViewBag.Regions       = db.ToList("UserRegions", Convert.ToString(ViewBag.UserId));
            TSS_SurveyDocumentBL sdb = new TSS_SurveyDocumentBL();

            ViewBag.Surveys     = sdb.ToList("GetAll_byIsActive", true.ToString());;
            ViewBag.Scopes      = sl.Definations("UserScopes", Convert.ToString(ViewBag.UserId));// sl.Scopes();
            ViewBag.Clients     = sl.Clients("UserClients", Convert.ToString(ViewBag.UserId));
            ViewBag.SiteTypes   = sl.Definations("SiteTypes");
            ViewBag.SiteClasses = sl.Definations("SiteClasses");
            ViewBag.CheckList   = sl.Definations("byDefinationType", "CheckList", "-CheckList-");
            ViewBag.Sectors     = sl.Sectors();
            WorkorderEdit we = new WorkorderEdit();

            return(View("Workorder", we));
        }
示例#16
0
        public ActionResult PlanProject(string Filter, Int64 ProjectId = 0, Int64 RevisionId = 0, DateTime?FromDate = null, DateTime?ToDate = null, string LocationIds = null, string TaskIds = null, string SiteStatus = null, Int64 UserId = 0)
        {
            PM_ProjectBL          pal        = new PM_ProjectBL();
            AD_DefinationBL       dbl        = new AD_DefinationBL();
            Sec_UserBL            ud         = new Sec_UserBL();
            List <PM_ProjectSite> result     = pal.PM_PlanProject(Filter, ProjectId, RevisionId, FromDate, ToDate, LocationIds, TaskIds, SiteStatus, UserId);
            List <SelectedList>   listStatus = dbl.SelectedList("byDefinationType", "Project Status");

            ViewBag.StatusId = listStatus;

            List <SelectedList>        listUsers    = ud.SelectedList("ByProjectId", ProjectId.ToString());
            List <PM_CompanyHierarchy> lstCompUsers = ListCompanyUsers("ByProjectId", ProjectId.ToString());

            List <Client> listOfClient = lstCompUsers.GroupBy(xx => xx.ClientId).Select(x => new Client()
            {
                ClientId      = x.Key,
                ClientName    = lstCompUsers.Where(XVC => XVC.ClientId == x.Key).FirstOrDefault().ClientName,
                userRolesList = lstCompUsers.Where(xr => xr.ClientId == x.Key).GroupBy(zx => zx.RoleId).Select(urol => new UserRoles()
                {
                    RoleId   = urol.Key,
                    RoleName = lstCompUsers.FirstOrDefault(zzzz => zzzz.RoleId == urol.Key).RoleName,
                    userList = lstCompUsers.Where(zzzz1 => zzzz1.RoleId == urol.Key && zzzz1.ClientId == x.Key).Select(usr => new Users()
                    {
                        FirstName = usr.FirstName,
                        LastName  = usr.LastName,
                        UserId    = usr.UserId,
                        UserName  = usr.UserName
                    }).ToList()
                }).ToList()
            }).ToList();

            foreach (var item in result)
            {
                item.SelectedListStatus = listStatus;
                item.Clients            = listOfClient;
                //item.ActualEndDate = item.ActualStartDate!=null? Convert.ToDateTime(item.ActualStartDate).ToShortDateString():null;
            }
            return(PartialView("~/Areas/Project/Views/Task/_PlanProject.cshtml", result));
        }
示例#17
0
        public ActionResult Script(Int64 LayerId, Int64 SiteId, Int64 NetworkModeId, Int64 BandId, string Scope, Int64 CarrierId, int?SiteClusterId = 0, int?ScopeId = 0)
        {
            if (SiteClusterId == 0)
            {
                ViewBag.CLS = "";
            }
            else
            {
                ViewBag.CLS = "CLS";
            }
            ViewBag.ScopeId = ScopeId;
            ViewBag.Scope   = Scope;
            //, Int64 BandId, Int64 CarrierId, Int64 ScopeId
            AD_DefinationBL db  = new AD_DefinationBL();
            AV_SiteScriptBL ssb = new AV_SiteScriptBL();

            ViewBag.PreviousRecord = ssb.ToList("ByNetLayerStatusId", LayerId.ToString());
            ViewBag.LayerId        = LayerId;

            ViewBag.SiteId        = SiteId;
            ViewBag.NetworkModeId = NetworkModeId;
            ViewBag.BandId        = BandId;
            ViewBag.CarrierId     = CarrierId;
            ViewBag.Events        = db.ToList("byDefinationType", "Script Events");
            ViewBag.ScriptTypes   = db.SelectedList("byDefinationType", "Script Type", null);
            ViewBag.SiteClusterId = SiteClusterId;
            List <AD_Defination> def = new List <AD_Defination>();

            def = db.ToList("byDefinationType", "Script Events");
            def.AddRange(db.ToList("byDefinationType", "Script Type"));
            def.AddRange(db.ToList("byDefinationType", "Script Sub Events"));
            ViewBag.definations = def;


            return(View());
            // return PartialView("~/views/NetLayerStatus/_Script.cshtml");
        }
示例#18
0
        // 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());
        }
示例#19
0
        //public List<AV_Site> ListIsActive(string value1 = null, string value2 = null, string value3 = null)
        //{
        //    DataTable dtbl = new DataTable();
        //    dtbl = wod.Get("Search", value1, value2, value3);
        //    List<AV_Site> WorkOrders = dtbl.ToList<AV_Site>();

        //    return WorkOrders;
        //}

        public bool ChangeFolderName(Workorder wo, List <Workorder> wolst)
        {
            try {
                List <string>           Newpath      = new List <string>();
                List <string>           OldPath      = new List <string>();
                AD_DefinationBL         db           = new AD_DefinationBL();
                int                     x            = 0;
                string                  ClientPrefix = "";
                string                  networkmode  = "";
                string                  carriors     = "";
                string                  bands        = "";
                var                     Newtworkmode = db.SelectedList("NetworkModes", null, "-NetworkMode-");
                var                     Bands        = db.ToList("Bands");
                var                     Carriers     = db.ToList("Carriers");
                List <AV_Sector>        Sectors      = new List <AV_Sector>();
                List <Changefoldername> t            = new List <Changefoldername>();
                List <Changefoldername> oldt         = new List <Changefoldername>();

                AV_SitesBL sb   = new AV_SitesBL();
                AV_Site    Site = new AV_Site();
                sb.SiteWithSectors(Convert.ToInt32(wo.SiteId), ref Site, ref Sectors);

                for (int i = 0; i < 1; i++)
                {
                    ClientPrefix = wolst[0].ClientPrefix;
                }



                var dt = wod.GetSiteBands("Get_All", wo.SiteId);
                if (wolst != null)
                {
                    if (wo.siteCode.ToString() == Site.SiteCode)
                    {
                        foreach (var row in Sectors)
                        {
                            foreach (var netmod in Newtworkmode)
                            {
                                if (netmod.Value == row.NetworkModeId.ToString())
                                {
                                    networkmode = netmod.Text;
                                }
                            }
                            foreach (var b in Bands)
                            {
                                if (b.DefinationId == row.BandId)
                                {
                                    bands = b.DefinationName;
                                }
                            }
                            foreach (var c in Carriers)
                            {
                                if (c.DefinationId == row.CarrierId)
                                {
                                    carriors = c.DefinationName;
                                }
                            }
                            var oldp            = "/Content/AirViewLogs/" + ClientPrefix + "/" + Site.SiteCode + '/' + networkmode + "_" + bands + "_" + carriors + "";
                            Changefoldername cf = new Changefoldername();
                            cf.Id   = Convert.ToInt64(row.SectorId);
                            cf.Path = oldp;
                            oldt.Add(cf);
                        }
                        foreach (var item in wolst)
                        {
                            foreach (var netmod in Newtworkmode)
                            {
                                if (netmod.Value == item.networkMode)
                                {
                                    networkmode = netmod.Text;
                                }
                            }
                            foreach (var b in Bands)
                            {
                                if (b.DefinationId.ToString() == item.Band)
                                {
                                    bands = b.DefinationName;
                                }
                            }
                            foreach (var c in Carriers)
                            {
                                if (c.DefinationId.ToString() == item.Carrier)
                                {
                                    carriors = c.DefinationName;
                                }
                            }


                            var p = "/Content/AirViewLogs/" + ClientPrefix + "/" + wo.siteCode.ToString() + '/' + networkmode + "_" + bands + "_" + carriors + "";
                            foreach (var itm in Sectors)
                            {
                                if (itm.SectorId == item.SectorId)
                                {
                                    Changefoldername cfn = new Changefoldername();
                                    cfn.Id   = Convert.ToInt64(item.SectorId);
                                    cfn.Path = p;
                                    t.Add(cfn);
                                    break;
                                }
                            }
                        }

                        List <long> RemoveLayesId = new List <long>();
                        foreach (var itme in t)
                        {
                            foreach (var tm in oldt)
                            {
                                if (itme.Id == tm.Id && itme.Path == tm.Path)
                                {
                                    RemoveLayesId.Add(itme.Id);
                                }
                            }
                        }
                        foreach (var r in RemoveLayesId)
                        {
                            var obj  = t.Where(xx => xx.Id == r).FirstOrDefault();
                            var obj1 = oldt.Where(xx => xx.Id == r).FirstOrDefault();
                            t.Remove(obj);
                            oldt.Remove(obj1);
                        }
                        for (int i = 0; i < t.Count; i++)
                        {
                            bool exists = System.IO.Directory.Exists(HttpContext.Current.Server.MapPath(oldt[i].Path));
                            if (exists)
                            {
                                bool exists1 = System.IO.Directory.Exists(HttpContext.Current.Server.MapPath(t[i].Path));
                                if (!exists1)
                                {
                                    t[i].Path    = HttpContext.Current.Server.MapPath(t[i].Path);
                                    oldt[i].Path = HttpContext.Current.Server.MapPath(oldt[i].Path);
                                    Directory.CreateDirectory(t[i].Path);
                                    DirectoryInfo dirInfo = new DirectoryInfo(t[i].Path);
                                    int           xx      = 0;
                                    int           y       = 0;
                                    List <String> MyFiles = Directory
                                                            .GetFiles(oldt[i].Path, "*.*", SearchOption.AllDirectories).ToList();

                                    foreach (string file in MyFiles)
                                    {
                                        FileInfo mFile = new FileInfo(file);
                                        // to remove name collisions
                                        if (new FileInfo(dirInfo + "\\" + mFile.Name).Exists == false)
                                        {
                                            mFile.MoveTo(dirInfo + "\\" + mFile.Name);
                                            xx++;
                                        }
                                    }
                                    //Directory.CreateDirectory(HttpContext.Current.Server.MapPath(t[i].Path));
                                    //      }
                                    //  System.IO.Directory.Move(HttpContext.Current.Server.MapPath(oldt[i].Path), HttpContext.Current.Server.MapPath(t[i].Path));
                                }
                                else
                                {
                                    t[i].Path    = HttpContext.Current.Server.MapPath(t[i].Path);
                                    oldt[i].Path = HttpContext.Current.Server.MapPath(oldt[i].Path);
                                    List <String> Files = Directory
                                                          .GetFiles(oldt[i].Path, "*.*", SearchOption.AllDirectories).ToList();



                                    if (Files.Count > 0)
                                    {
                                        var MyFiles = Directory
                                                      .GetFiles(oldt[i].Path, "*.*", SearchOption.AllDirectories).ToList();

                                        foreach (string file in MyFiles)
                                        {
                                            FileInfo mFile = new FileInfo(file);
                                            // to remove name collisions
                                            if (new FileInfo(t[i].Path + "\\" + mFile.Name).Exists == false)
                                            {
                                                mFile.MoveTo(t[i].Path + "\\" + mFile.Name);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        var oldp    = "/Content/AirViewLogs/" + ClientPrefix + "/" + Site.SiteCode + '/';
                        var p       = "/Content/AirViewLogs/" + ClientPrefix + "/" + wo.siteCode.ToString() + '/';
                        var newPath = HttpContext.Current.Server.MapPath(p);
                        var oldPath = HttpContext.Current.Server.MapPath(oldp);
                        DirectoryCopy(oldPath, newPath, true);
                        clearFolder(oldPath);
                        DeleteFolder(oldPath);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#20
0
        public bool ChangeFolderName(long networklayerid, string SiteCode)
        {
            try
            {
                AD_DefinationBL     db           = new AD_DefinationBL();
                int                 x            = 0;
                string              ClientPrefix = "";
                string              networkmode  = "";
                string              carriors     = "";
                string              bands        = "";
                var                 Newtworkmode = db.SelectedList("NetworkModes", null, "-NetworkMode-");
                var                 Bands        = db.ToList("Bands");
                var                 Carriers     = db.ToList("Carriers");
                string              oldpath      = "";
                string              newpath      = "";
                AV_NetLayerStatusBL nlsb         = new AV_NetLayerStatusBL();

                var rec = nlsb.ToSingle("Get_byLayerStatusId", 0, 0, 0, 0, networklayerid.ToString());

                AV_SitesBL sb      = new AV_SitesBL();
                AV_Site    oldSite = new AV_Site();
                oldSite = sb.Single("SingleSitebyId", rec.SiteId.ToString(), null, null, null, null);
                AV_Site newSite = new AV_Site();
                newSite = sb.Single("SingleSitebySiteCode", SiteCode.ToString(), null, null, null, null);
                var Newrec        = nlsb.ToSingle("Get_byLayerStatusId", 0, 0, 0, 0, networklayerid.ToString());
                var oldSiteRecord = sb.ToList("BySiteCodeWithLayer", oldSite.SiteCode, null, null, null, null, null);
                var newSiteRecord = sb.ToList("BySiteCodeWithLayer", newSite.SiteCode, null, null, null, null, null);

                foreach (var netmod in Newtworkmode)
                {
                    if (netmod.Value == rec.NetworkModeId.ToString())
                    {
                        networkmode = netmod.Text;
                    }
                }
                foreach (var b in Bands)
                {
                    if (b.DefinationId == rec.BandId)
                    {
                        bands = b.DefinationName;
                    }
                }
                foreach (var c in Carriers)
                {
                    if (c.DefinationId == rec.CarrierId)
                    {
                        carriors = c.DefinationName;
                    }
                }
                oldpath = "/Content/AirViewLogs/" + oldSiteRecord[0].ClientPrefix + "/" + oldSite.SiteCode + "/" + networkmode + "_" + bands + "_" + carriors + "";

                foreach (var netmod in Newtworkmode)
                {
                    if (netmod.Value == Newrec.NetworkModeId.ToString())
                    {
                        networkmode = netmod.Text;
                    }
                }
                foreach (var b in Bands)
                {
                    if (b.DefinationId == Newrec.BandId)
                    {
                        bands = b.DefinationName;
                    }
                }
                foreach (var c in Carriers)
                {
                    if (c.DefinationId == Newrec.CarrierId)
                    {
                        carriors = c.DefinationName;
                    }
                }


                newpath = "/Content/AirViewLogs/" + newSiteRecord[0].ClientPrefix + "/" + newSite.SiteCode + '/' + networkmode + "_" + bands + "_" + carriors + "";

                var         newPath = HttpContext.Current.Server.MapPath(newpath);
                var         oldPath = HttpContext.Current.Server.MapPath(oldpath);
                WorkOrderBL wo      = new WorkOrderBL();
                wo.DirectoryCopy(oldPath, newPath, true);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#21
0
        public ActionResult GetWorkOrders(string q)
        {
            AD_DefinationBL db = new AD_DefinationBL();

            return(Json(new { items = db.SelectedList("getWorkOrders", q).Select(x => new { text = x.Text, id = x.Value }) }, JsonRequestBehavior.AllowGet));
        }
示例#22
0
        private void NewData()
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.Modules = db.SelectedList("byDefinationType", "Module", "-Module-");
        }
示例#23
0
        public ActionResult Edit(int Id = 0)
        {
            ViewBag.FormType = "Edit";
            AV_SitesBL       sb      = new AV_SitesBL();
            AV_Site          Site    = new AV_Site();
            List <AV_Sector> Sectors = new List <AV_Sector>();

            sb.SiteWithSectors(Id, ref Site, ref Sectors);
            ViewBag.Site = Site;
            Common.SelectedList sl = new Common.SelectedList();
            AD_DefinationBL     db = new AD_DefinationBL();

            ViewBag.NetworkModes = db.SelectedList("NetworkModes", null, "-NetworkMode-");
            ViewBag.Bands        = db.ToList("Bands");
            ViewBag.Carriers     = db.ToList("Carriers");
            ViewBag.Scopes       = sl.Scopes();
            ViewBag.Sectors      = sl.Sectors();
            List <SWI.Libraries.Common.SelectedList> Markets = new List <SelectedList>();

            if (ViewBag.IsAdmin)
            {
                ViewBag.UserMarkets = db.SelectedList("AllCities");
                Markets             = ViewBag.UserMarkets;
            }
            else
            {
                ViewBag.UserMarkets = db.SelectedList("UserCities", Convert.ToString(ViewBag.UserId));
                Markets             = ViewBag.UserMarkets;
            }


            //bands network mode etc dropdowns
            WorkorderEdit      we  = new WorkorderEdit();
            Sec_UserSettingsDL udl = new Sec_UserSettingsDL();

            we.Site           = Site;
            we.Site.StateId   = we.Site.State;
            we.Site.RegionId  = we.Site.Region;
            we.Site.MarketId  = we.Site.Market;
            we.Site.SiteType  = we.Site.SiteTypeId;
            we.Site.SiteClass = we.Site.SiteClassId;
            we.Bands          = ViewBag.Bands;
            ViewBag.Id        = Id;

            we.Carriers = ViewBag.Carriers;

            DataTable Table = udl.GetDataTable("UserProjects", Convert.ToString(ViewBag.UserId), null, null);

            we.Projects     = Table.ToList <PM_Projects>();
            we.Cities       = db.ToList("UserCities", Convert.ToString(ViewBag.UserId));
            we.SubCheckList = db.ToList("byDefinationType", "Sub CheckList");

            we.NetworkModes = ViewBag.NetworkModes;
            var hjh = db.MultiSelecet("NetworkModes", null, "-NetworkMode-");

            we.NetworkModesm = hjh;
            we.States        = sl.Definations("UserStates", Convert.ToString(ViewBag.UserId), "-State-"); //sl.States();
            we.Regions       = db.ToList("UserRegions", Convert.ToString(ViewBag.UserId));
            // we.Regions = we.Regions.Where(x => x.PDefinationId ==we.State).ToList();
            we.UserMarkets = Markets;
            //   we.UserMarkets = we.UserMarkets;    //.Where(x=>x.Value==Convert.ToString(we.Region)).ToList();
            TSS_SurveyDocumentBL sdb = new TSS_SurveyDocumentBL();

            we.Surveys             = sdb.ToList("GetAll_byIsActive", true.ToString());
            we.Clients             = sl.Clients("UserClients", Convert.ToString(ViewBag.UserId));
            we.Scopes              = sl.Definations("UserScopes", Convert.ToString(ViewBag.UserId));// sl.Scopes();
            we.SiteTypes           = sl.Definations("SiteTypes");
            we.SiteClasses         = sl.Definations("SiteClasses");
            we.CheckList           = sl.Definations("byDefinationType", "CheckList", "-CheckList-");
            we.Sectors             = Sectors;
            we.Sectors[0].Bands    = we.Bands;
            we.Sectors[0].Carriers = we.Carriers;

            return(View("Workorder", we)); // return View(Sectors);
        }