示例#1
0
 public ActionResult ContactEdit(int cid)
 {
     var m = new ContactModel(cid);
     if (!m.CanViewComments)
         return View("ContactDisplay", m);
     return View(m);
 }
示例#2
0
 public ActionResult ContactUpdate(int cid, ContactModel c)
 {
     if (!User.IsInRole("Admin") && !ModelState.IsValid)
         return View("ContactEdit", c);
     c.UpdateContact();
     return View("ContactDisplay", c);
 }
示例#3
0
        public ActionResult Index(int cid)
        {
            if (!ViewExtensions2.UseNewLook())
                return Redirect("/Contact/" + cid);
            var m = new ContactModel(cid);
            if (m.contact == null)
                return Content("contact is private or does not exist");

            var edit = (bool?)TempData["ContactEdit"] == true;
            ViewBag.edit = edit;
            return View(m);
        }
示例#4
0
        public ActionResult Index(int cid, bool edit = false)
        {
            var m = new ContactModel(cid);
            if (m.contact == null)
                return Content("contact is private or does not exist");

            if( edit )
            {
                TempData["ContactEdit"] = true;
                return Redirect($"/Contact2/{cid}");                
            }
            else
            {
                var showEdit = (bool?)TempData["ContactEdit"] == true;
                ViewBag.edit = showEdit;
                return View(m);
            }
        }
示例#5
0
 public ActionResult Contactors(int cid)
 {
     var m = new ContactModel(cid);
     return View(m.Ministers);
 }
示例#6
0
 public ActionResult ContactDisplay(int cid)
 {
     var m = new ContactModel(cid);
     return View(m);
 }
示例#7
0
 public ActionResult NewTeamContact(int cid)
 {
     var m = new ContactModel(cid);
     var nid = m.AddNewTeamContact();
     return Redirect("/Contact2/" + nid);
 }
示例#8
0
        public ActionResult Index(int cid, bool edit = false)
        {
            var m = new ContactModel(cid);
            if (m.contact == null)
                return Content("contact is private or does not exist");

            if( edit )
            {
                TempData["ContactEdit"] = true;
                return Redirect($"/Contact2/{cid}");
            }
            else
            {
                if (TempData.ContainsKey("SetRole"))
                    m.LimitToRole = TempData["SetRole"].ToString();

                var showEdit = (bool?)TempData["ContactEdit"] == true;
                ViewBag.edit = showEdit;
                return View(m);
            }
        }
示例#9
0
        public ActionResult Index(int cid)
        {
            var m = new ContactModel(cid);
            if (m.contact == null)
                return Content("contact is private or does not exist");

            var edit = (bool?)TempData["ContactEdit"] == true;
            ViewBag.edit = edit;
            return View(m);
        }