// 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());
        }
示例#2
0
        public Response _LookupData(int _ProjectId)
        {
            Response      _res    = new Response();
            PM_LookupData _lookup = new PM_LookupData();

            try
            {
                PM_TaskEntryBL  te = new PM_TaskEntryBL();
                AD_DefinationBL db = new AD_DefinationBL();
                _lookup.GroupResources   = te.GET_Group_LIST("PopulateGroupResources").ToList();
                _lookup.ProjectResources = te.GET_Group_LIST("PopulateUserResourcesProject", _ProjectId).Where(x => x.ResourceName != null && x.ResourceName != "").ToList();

                _lookup.ProjectStatus = db.ToList("byDefinationType", "Project Task Status");
                _lookup.Priorities    = db.ToList("byDefinationType", "Priority");
                Sec_UserBL ud = new Sec_UserBL();
                _res.Message = "Ok";
                _res.Status  = "true";
                _res.Value   = _lookup;
                return(_res);
            }
            catch (Exception _ex)
            {
                _res.Message = _ex.Message;
                _res.Status  = "false";
                _res.Value   = _lookup;
                return(_res);
            }
        }
示例#3
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());
        }
        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());
        }
示例#5
0
        public ActionResult ReportFilters(Int64 ReportId)
        {
            AD_DefinationBL db  = new AD_DefinationBL();
            var             rec = db.ToList("ReportFilters_byReportId", ReportId.ToString());

            return(Json(rec, JsonRequestBehavior.AllowGet));
        }
示例#6
0
        public ActionResult GetOptionIdsByBand(string band = "", string search = "", string start = "", string next = "")
        {
            AD_DefinationBL abc       = new AD_DefinationBL();
            var             OptionIds = abc.ToList("byDefinationTypeOptionBand", band + "," + search + "," + start + "," + next);

            return(Json(OptionIds, JsonRequestBehavior.AllowGet));
        }
示例#7
0
        public JsonResult ToList(string filter, string value)
        {
            AD_DefinationBL db  = new AD_DefinationBL();
            var             rec = db.ToList(filter, value);

            return(Json(rec, JsonRequestBehavior.AllowGet));
        }
示例#8
0
        public ActionResult Inde2x()
        {
            AD_DefinationBL db = new AD_DefinationBL();
            //
            var rec = db.ToList("ReportTree");

            return(View(rec));
        }
示例#9
0
        public ActionResult ModuleApps()
        {
            AD_DefinationBL      pl   = new AD_DefinationBL();
            List <AD_Defination> apps = pl.ToList("byModuleApps", "0");

            ViewBag.Apps = apps;
            return(PartialView("~/Views/Equipment/_ModuleApps.cshtml", apps));
        }
示例#10
0
        // GET: Report


        public ActionResult Index1()
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.Region = db.ToList("Regions").GroupBy(l => l.DefinationName)
                             .Select(cl => new  {
                Name = cl.First().DefinationName
            }).ToList();

            return(View());
        }
示例#11
0
        public JsonResult Details(Int64 Id, string Key)
        {
            PM_ProjectBL pd      = new PM_ProjectBL();
            var          Project = pd.ToSingle("ByProjectId", Id.ToString());

            AD_DefinationBL db            = new AD_DefinationBL();
            var             ProjectStatus = db.ToList("byDefinationType", "Project Status");
            Int64           UserId        = ViewBag.UserId;
            var             UserScopes    = db.ToList("UserScopes", UserId.ToString());
            var             Priorities    = db.ToList("byDefinationType", "Priority");
            var             FormTypes     = db.ToList("byDefinationType", "FormType");
            var             TaskTypes     = db.ToList("byDefinationType", "Task Types");
            Sec_UserBL      ud            = new Sec_UserBL();
            List <Sec_User> Users         = ud.ToList("ByProjectId", Id.ToString());

            Users = Users.Select(c => { c.Password = ""; return(c); }).ToList();

            return(Json(new { Project = Project, ProjectStatus = ProjectStatus, UserScopes = UserScopes
                              , Priorities = Priorities, FormTypes = FormTypes, Users = Users, TaskTypes = TaskTypes }, JsonRequestBehavior.AllowGet));
        }
示例#12
0
 public ActionResult GetFilters(string Type)
 {
     try
     {
         AD_DefinationBL db = new AD_DefinationBL();
         return(Json(db.ToList("byDefinationType", Type), JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(null);
     }
 }
示例#13
0
 public ActionResult Definations(string Filter)
 {
     try
     {
         AD_DefinationBL db = new AD_DefinationBL();
         return(Json(db.ToList(Filter), JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(null);
     }
 }
示例#14
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));
        }
示例#15
0
        public List <SelectListItem> WoStatus()
        {
            List <SelectListItem> items = new List <SelectListItem>();
            AD_DefinationBL       ucb   = new AD_DefinationBL();
            var lst = ucb.ToList("WO Status");

            foreach (var item in lst)
            {
                items.Add(new SelectListItem {
                    Text = item.DefinationName, Value = item.DefinationId.ToString()
                });
            }
            return(items);
        }
示例#16
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());
        }
示例#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
        public JsonResult ScriptKPI(string value)
        {
            if (value != null)
            {
                AD_DefinationBL db = new AD_DefinationBL();

                var rec = db.ToList("byDefinationType", value);
                //AD_DefinationBL db = new AD_DefinationBL();
                //var rec = db.ToList("GetSettings", value).Where(m=>m.DefinationTypeId==15).ToList();


                return(Json(rec, JsonRequestBehavior.AllowGet));
            }
            return(null);
        }
示例#19
0
        public HttpResponseMessage UserLocations(string filter, string UserId)
        {
            AD_DefinationBL db     = new AD_DefinationBL();
            var             result = db.ToList(filter, UserId);

            if (result != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound,
                                                   "No Location(s) found"));
            }
        }
示例#20
0
        public ActionResult WoStatus(Int64 LayerId)
        {
            AV_NetLayerStatusBL nlsb = new AV_NetLayerStatusBL();
            var rec = nlsb.ToSingle("Get_byLayerStatusId", 0, 0, 0, 0, LayerId.ToString());

            if (rec != null)
            {
                AD_DefinationBL db     = new AD_DefinationBL();
                var             Status = db.ToList("byDefinationType", "WO Status");
                int             Order  = Status.Where(m => m.DefinationId == rec.Status).Select(m => m.SortOrder).FirstOrDefault();
                ViewBag.Status = Status.Where(m => m.SortOrder < Order && m.SortOrder > 0).Select(m => new SWI.Libraries.Common.SelectedList {
                    Value = m.DefinationId.ToString(), Text = m.DefinationName
                }).ToList();
            }
            return(PartialView("~/views/NetLayerStatus/_WoStatus.cshtml", rec));
        }
示例#21
0
        public List <SelectListItem> Scopes()
        {
            List <SelectListItem> items = new List <SelectListItem>();
            AD_DefinationBL       db    = new AD_DefinationBL();
            var lst = db.ToList("Scopes");

            items.Add(new SelectListItem {
                Text = "-Scope-", Value = "0"
            });
            foreach (var item in lst)
            {
                items.Add(new SelectListItem {
                    Text = item.DefinationName, Value = item.DefinationId.ToString()
                });
            }
            return(items);
        }
示例#22
0
        public List <SelectListItem> Sectors()
        {
            List <SelectListItem> items = new List <SelectListItem>();
            AD_DefinationBL       db    = new AD_DefinationBL();
            var lst = db.ToList("Sectors");

            items.Add(new SelectListItem {
                Text = "-Sector-", Value = ""
            });
            foreach (var item in lst)
            {
                items.Add(new SelectListItem {
                    Text = item.DefinationName, Value = item.DefinationName
                });
            }
            return(items);
        }
示例#23
0
        public ActionResult New()
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.Definations = db.ToList("AllActive");
            Sec_UserDefinationTypeBL dtb = new Sec_UserDefinationTypeBL();
            var User = Session["user"] as LoginInformation;

            ViewBag.DefinationTypes = dtb.ToListDefinations("GetDefinationTypeByUId", User.UserId.ToString());

            //AD_DefinationTypesBL dtb = new AD_DefinationTypesBL();
            //ViewBag.DefinationTypes = dtb.ToList("All");

            SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
            ViewBag.SelectedDefinationTypes = sl.UserDefinationTypes(User.UserId.ToString());
            //
            return(View());
        }
示例#24
0
        public List <SelectListItem> RegionWithParent(string Filter, string value = null, string Message = null)
        {
            List <SelectListItem> items = new List <SelectListItem>();
            AD_DefinationBL       db    = new AD_DefinationBL();
            var lst = db.ToList(Filter, value);

            items.Add(new SelectListItem {
                Text = "Select", Value = "0"
            });


            foreach (var item in lst)
            {
                items.Add(new SelectListItem {
                    Text = item.DefinationName + " " + item.PDefinationName, Value = item.DefinationId.ToString()
                });
            }
            return(items);
        }
示例#25
0
 public JsonResult GetBC()
 {
     try
     {
         AD_DefinationBL abc                = new AD_DefinationBL();
         var             Carriers           = abc.ToList("Carriers", "");
         var             Bands              = abc.ToList("Bands", "");
         var             ScannerBand        = abc.ToList("byDefinationType", "Scanner Band");
         var             ScannerProtocol    = abc.ToList("byDefinationType", "Scanner Protocol");
         var             ScannerMeasurement = abc.ToList("byScannerModel", "Scanner Measurement Type");
         var             Manufacturer       = abc.ToList("byDefinationType", "ScannerManufacturer");
         var             ScannerModel       = abc.ToList("byDefinationType", "ScannerModel");
         return(Json(new { Status = "Success", Carriers = Carriers, Bands = Bands, ScannerProtocol = ScannerProtocol, ScannerMeasurement = ScannerMeasurement, ScannerBand = ScannerBand, Manufacturer = Manufacturer, ScannerModel = ScannerModel }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new { Status = "error" }, JsonRequestBehavior.AllowGet));
     }
 }
示例#26
0
        public ActionResult Index(int id = 0)
        {
            if (id == 0)
            {
                return(RedirectToAction("Index", "Dashboard"));
            }

            string ModuleKeyCode = "MD_SITE";
            var    ProjectId     = TemplatesBL.ToList("GetProjectIdBySiteId", id.ToString()).FirstOrDefault();

            if (ProjectId != null)
            {
                var templateData = TemplatesBL.ToList("IsTemplateExist", ModuleKeyCode).Where(x => x.ProjectId == ProjectId?.ProjectId).FirstOrDefault();
                if (templateData != null && ProjectId != null)
                {
                    return(Redirect($"/Project/Template/Dashboard?Id={templateData.TemplateId}&ProjectId={templateData.ProjectId}"));
                }
            }

            ViewBag.SiteId = id;
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.WoStatus = db.ToList("WO Status");
            WebConfig wc = new WebConfig();

            ViewBag.domain = wc.AppSettings("Domain");
            AV_GetSiteDashboardInfoBL sdb = new AV_GetSiteDashboardInfoBL();
            var rec = sdb.GetDataSet(id, 0, 0, 0, 0, "Dashboard_Site_All");

            ViewBag.PingThroughtputChart = rec.PingThroughtput;
            ViewBag.DLThroughtputChart   = rec.DLThroughtput;
            ViewBag.ULThroughtputChart   = rec.ULThroughtput;

            ViewBag.GmapsKey = WebConfigurationManager.AppSettings["ApiMapKey"];
            return(View(rec));
        }
示例#27
0
        public ActionResult Colors()
        {
            AD_DefinationBL db = new AD_DefinationBL();

            return(View(db.ToList("Colors")));
        }
示例#28
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;
            }
        }
示例#29
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;
            }
        }
示例#30
0
        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));
        }