Example #1
0
        public WebApplication.Models.ThreatReportViewModel InitializeWhoToNotify(Models.ThreatReportViewModel ModelData)
        {
            //  Models.ThreatReportViewModel ModelData = new Models.ThreatReportViewModel();
            ModelData.AllCheckBoxesNotify = new List <Models.CheckBoxLists>()
            {
                new Models.CheckBoxLists {
                    Id = "police", Name = "police"
                },
                new Models.CheckBoxLists {
                    Id = "goverment", Name = "goverment"
                },
                new Models.CheckBoxLists {
                    Id = "local Unions", Name = "local Unions"
                },
                new Models.CheckBoxLists {
                    Id = "International bodies", Name = "International bodies"
                }
            };
            ModelData.UserSelectedCheckBoxesNotify = new List <Models.CheckBoxLists>()
            {
            };
            ModelData.SelectedCheckBoxesNotify = ModelData.UserSelectedCheckBoxesNotify.Select(x => x.Id).ToArray();

            return(ModelData);
        }
Example #2
0
        public WebApplication.Models.ThreatReportViewModel Initialize(Models.ThreatReportViewModel ModelData)
        {
            //  Models.ThreatReportViewModel ModelData = new Models.ThreatReportViewModel();
            ModelData.AllCheckBoxes = new List <Models.CheckBoxLists>()
            {
                new Models.CheckBoxLists {
                    Id = "police", Name = "police"
                },
                new Models.CheckBoxLists {
                    Id = "organization", Name = "organization"
                },
                new Models.CheckBoxLists {
                    Id = "colleagues", Name = "colleagues"
                },
                new Models.CheckBoxLists {
                    Id = "family", Name = "family"
                },
                new Models.CheckBoxLists {
                    Id = "friends", Name = "friends"
                },
                new Models.CheckBoxLists {
                    Id = "None", Name = "None"
                }
            };
            ModelData.UserSelectedCheckBoxes = new List <Models.CheckBoxLists>()
            {
            };
            ModelData.SelectedCheckBoxes = ModelData.UserSelectedCheckBoxes.Select(x => x.Id).ToArray();

            return(ModelData);
        }
Example #3
0
 public ActionResult ThreatDetails(string id)
 {
     Models.ThreatReportViewModel Detailmodel = user.GetUserThreatDetails(Int32.Parse(id));
     if (Detailmodel != null)
     {
         return(View(Detailmodel));
     }
     else
     {
         return(RedirectToAction("ThreatSearchIndex", "Admin"));
     }
 }
Example #4
0
        public ActionResult ReportThreat(Models.ThreatReportViewModel modelobj)
        {
            var      outputTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pakistan Standard Time");
            DateTime now            = TimeZoneInfo.ConvertTime(DateTime.Now, outputTimeZone);

            modelobj.Users = (WebApplication.Models.cPerson)Session["User"];
            if (LogedInUsers.reportathreat(modelobj))
            {
                string SmSbody = "Threat Report from : \n" + modelobj.Users.UserName + ", Registration Id:" + modelobj.Users.Registration_Id + ", Mobileno:" + modelobj.Users.mobilde + ",Organizationname " + modelobj.Users.orgname + ", DateandTime: " + now;

                sendsms(SmSbody, "923355243732");


                var message = "Your Threat Report has been sent Wait for call.";

                return(RedirectToAction("Login", "Home", new { returnmessage = message }));
            }
            else
            {
                var message = "Error in reporting your Threat try again.";

                return(RedirectToAction("ReportaThreat", "User", new { returnmessage = message }));
            }
        }
Example #5
0
 public ActionResult ReportaThreat(string returnmessage)
 {
     Response.Cache.SetCacheability(HttpCacheability.NoCache);
     Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
     Response.Cache.SetNoStore();
     if (Session != null)
     {
         if (Session["User"] == null)
         {
             return(RedirectToAction("Login", "Home"));
         }
         else
         {
             Models.ThreatReportViewModel modelobj = new Models.ThreatReportViewModel();
             modelobj.Users  = (WebApplication.Models.cPerson)Session["User"];
             ViewBag.message = returnmessage;
             return(View(modelobj));
         }
     }
     else
     {
         return(RedirectToAction("Login", "Home"));
     }
 }