Beispiel #1
0
        public virtual ActionResult CommitteeSection()
        {
            _objuser = new UserPresenter();
            var committee = _objuser.GetAllMembersToCommittee();

            return(View(committee.ToList()));
        }
Beispiel #2
0
        public virtual ActionResult DashBoard()
        {
            _objuser = new UserPresenter();
            List <UserModel> users = _objuser.GetUserList();

            return(View(users));
        }
Beispiel #3
0
        public virtual ActionResult DeleteSubscription(string id)
        {
            _objuser = new UserPresenter();
            var result = _objuser.DeleteSubscribed(long.Parse(id));

            return(RedirectToAction(MVC.Admin.SubscribedMembers()));
        }
Beispiel #4
0
        public virtual ActionResult NewsEvents(NewsEventsModel model, HttpPostedFileBase[] file1, string myArea1, FormCollection form)
        {
            //if (model.Id == 0)
            //{

            //    if (file1 != null)
            //    {
            //        if (file1[0] == null && model.Id == 0)
            //        {
            //            ModelState.AddModelError("ImageUpload", "Please upload Event Image");
            //        }
            //    }


            //}

            if (ModelState.IsValid && model != null)
            {
                _objuser = new UserPresenter();

                model.IsActive = true;
                if (file1 != null)
                {
                    model.ImagesBases = file1;
                }
                _objuser.Addnewsevent(model);
                return(RedirectToAction(MVC.Admin.NewsEventsView()));
            }
            else
            {
                string message = "Inavlid data";
                ModelState.AddModelError("", message);
            }
            return(View());
        }
Beispiel #5
0
        public virtual ActionResult NewsEventsView()
        {
            _objuser = new UserPresenter();
            List <NewsEventsModel> events = _objuser.GetnewseventsList().OrderByDescending(a => a.Id).ToList();

            return(View(events));
        }
 /// <summary>
 /// 字段及依赖注入构造器
 /// </summary>
 /// <param name="userPresenter">用户呈现器接口</param>
 /// <param name="authenticationContract">身份认证服务接口</param>
 /// <param name="userContract">用户服务接口</param>
 /// <param name="systemPresenter">信息系统呈现器接口</param>
 public UserController(IUserPresenter userPresenter, IAuthenticationContract authenticationContract, IUserContract userContract, IInfoSystemPresenter systemPresenter)
 {
     this._userPresenter          = userPresenter;
     this._authenticationContract = authenticationContract;
     this._userContract           = userContract;
     this._systemPresenter        = systemPresenter;
 }
Beispiel #7
0
        public virtual ActionResult SendMail(OnlineEnquiryModel model)
        {
            _objuser = new UserPresenter();
            if (ModelState.IsValid)
            {
                try
                {
                    var mailHelper = new MailHelper();
                    var subject    = "Contact us request from:" + model.Name;
                    var to         = ConfigurationManager.AppSettings["EmailFrom"];
                    var from       = model.Email;
                    var mailBody   = new StringBuilder();

                    mailBody.Append("A new Enquiry Notification from Sikh Society Nazareth PA Web Portal:");
                    mailBody.Append("<br/><br/>");
                    mailBody.Append(model.Query);
                    mailBody.Append("<br/><br/>Requestor Information: ");
                    mailBody.Append("<br/><br/>Name: " + model.Name);
                    mailBody.Append("<br/><br/>Phone: " + model.Phone);
                    mailBody.Append("<br/><br/>Email: " + from);
                    MailHelper.SendMailMessage(from, to, "", "", subject, mailBody.ToString());
                    TempData["Message"] = "Your request has been sent successfully.";
                    return(RedirectToAction("Contact"));
                }

                catch (HttpException ex)
                {
                    Response.Write("Error: " + ex.ToString());
                }
            }
            SessionManager.ContactUsinfo = _objuser.GetContact(1);
            return(View("Contact", model));
        }
Beispiel #8
0
        public virtual ActionResult CommitteMembers()
        {
            _objuser = new UserPresenter();
            var membersList = (List <CommitteMemberModel>)_objuser.GetallCommitteeMembers();

            return(View(membersList));
        }
Beispiel #9
0
        public virtual ActionResult VideoGalleryListView()
        {
            _objuser = new UserPresenter();
            var videolist = _objuser.VideoList().ToList();

            return(View(videolist));
        }
Beispiel #10
0
        public virtual ActionResult Delete(string id)
        {
            _objuser = new UserPresenter();
            var result = _objuser.Deleteuser(long.Parse(id));

            return(RedirectToAction(MVC.Admin.DashBoard()));
        }
Beispiel #11
0
        public virtual ActionResult GetHukamnamasResult()
        {
            _objuser = new UserPresenter();
            var hukamnamalist = _objuser.GetHukamnamasList();

            return(View(hukamnamalist.ToList()));
        }
Beispiel #12
0
        public virtual ActionResult SubscribedMembers()
        {
            _objuser = new UserPresenter();
            var subscribed = _objuser.SubscribedList();

            return(View(subscribed));
        }
Beispiel #13
0
        public virtual ActionResult GalleryView()
        {
            _objuser = new UserPresenter();
            var imagelist = _objuser.ImageList().OrderByDescending(a => a.Id).ToList();

            return(View(imagelist.ToList()));
        }
Beispiel #14
0
        //public virtual ActionResult EventGalleryDetailView(string id)
        //{
        //    _objuser = new UserPresenter();
        //    var details = new EventGalleryModel();
        //    if (!string.IsNullOrEmpty(id))
        //    {
        //        details = _objuser.GetGalleryEventById(long.Parse(id));
        //    }

        //    return View(details);
        //}

        public virtual ActionResult EventGalleryList()
        {
            _objuser = new UserPresenter();
            var events = _objuser.GetAllGalleryEvnets().OrderByDescending(a => a.Id).ToList();

            return(View(events));
        }
Beispiel #15
0
        public virtual ActionResult ViewPagesGrid()
        {
            _objuser = new UserPresenter();
            IEnumerable <PagesModel> pages = _objuser.GetAllactivePages();

            return(View(pages));
        }
Beispiel #16
0
        public virtual ActionResult ForgotPassword(ForgotPassword model)
        {
            if (ModelState.IsValid)
            {
                _objuser = new UserPresenter();
                var username = _objuser.GetUserbyusername(model.UserName);
                if (username != null)
                {
                    var reset = _objuser.ForgotPassword(model.UserName);
                    Notification.SendPasswordRetrieval(reset.EmailAddress, model.UserName, reset.Password);
                    TempData["Message"] = "Please check your email for the Password Recovery Details";
                    return(RedirectToAction(MVC.Account.Login()));
                }

                else
                {
                    ViewBag.error = "Please enter the correct details";
                    return(View(model));
                }
            }

            const string error = "User name is Required";

            ModelState.AddModelError("", error);
            return(View(model));
        }
Beispiel #17
0
        public virtual ActionResult Login(LogonModel objuserinfo)
        {
            if (ModelState.IsValid)
            {
                _objuser = new UserPresenter();
                bool isvalid = _objuser.IsValid(objuserinfo.UserName, objuserinfo.Password);

                if (isvalid)
                {
                    var user = _objuser.GetUserbyusername(objuserinfo.UserName);

                    SessionManager.DisplayName = user.UserName;
                    SessionManager.Name        = user.FirstName + "  " + user.LastName;
                    SessionManager.UserId      = user.UserId;
                    FormsAuthentication.SetAuthCookie(objuserinfo.UserName, objuserinfo.RememberMe);
                    return(RedirectToAction("Dashboard", "Admin"));
                }
                else
                {
                    ViewBag.error = "The user name or password provided is incorrect.";
                    return(View(objuserinfo));
                }
            }
            ViewBag.error = "User Name and Password is required.";
            return(View(objuserinfo));
        }
Beispiel #18
0
        public virtual PartialViewResult GetEventbyDate(string requestData)
        {
            _objuser = new UserPresenter();
            var date      = Convert.ToDateTime(requestData);
            var eventdata = _objuser.Geteventbycurrentdate(date);

            return(PartialView("_eventdatedata", eventdata));
        }
Beispiel #19
0
        public virtual ActionResult ContactusDetailView(int id)
        {
            _objuser = new UserPresenter();

            var contactdetail = _objuser.GetContact(id);

            return(View(contactdetail));
        }
Beispiel #20
0
        public virtual ActionResult ContactusView()
        {
            _objuser = new UserPresenter();

            var list = _objuser.GetContactUsList();

            return(View(list));
        }
Beispiel #21
0
        public virtual ActionResult GetEventImagesbyEvent(long id)
        {
            _objuser = new UserPresenter();
            var model = _objuser.GetAllGalleryEvnetImagesById(id).ToList();

            SessionManager.NewsEventsList = _objuser.GetnewseventsList();
            return(View(model));
        }
Beispiel #22
0
        public virtual ActionResult DeletePage(string id)
        {
            _objuser = new UserPresenter();

            var result = _objuser.Deletecontent(long.Parse(id));

            return(RedirectToAction(MVC.Admin.ViewPagesGrid()));
        }
Beispiel #23
0
        public virtual ActionResult VideoGallery()
        {
            _objuser = new UserPresenter();
            var model = _objuser.VideoList();

            SessionManager.VideosList = _objuser.VideoList();
            return(View(model));
        }
Beispiel #24
0
        public virtual ActionResult LatestEventsList()
        {
            _objuser = new UserPresenter();
            //SessionManager.NewsEvents = _objuser.Geteventbydate(DateTime.Now.Date);

            SessionManager.NewsEventsList = _objuser.GetnewseventsList();
            return(View());
        }
Beispiel #25
0
        public virtual ActionResult Gallery()
        {
            _objuser = new UserPresenter();
            var model = _objuser.GetAllGalleryEvnets().ToList();

            SessionManager.NewsEventsList = _objuser.GetnewseventsList();
            return(View(model));
        }
Beispiel #26
0
 public virtual ActionResult DeleteContactus(string id)
 {
     _objuser = new UserPresenter();
     if (!string.IsNullOrEmpty(id))
     {
         var result = _objuser.DeleteContact(int.Parse(id));
     }
     return(RedirectToAction(MVC.Admin.ContactusView()));
 }
Beispiel #27
0
 public void SetPresenter(IUserPresenter presenter)
 {
     DataContext = presenter;
     if (!string.IsNullOrEmpty(presenter.Senha))
     {
         this.PassWord1.Password = presenter.Senha;
         this.PassWord2.Password = presenter.Senha;
     }
 }
Beispiel #28
0
        public virtual ActionResult Contact()
        {
            _objuser = new UserPresenter();
            var model = _objuser.GetContact(1);

            SessionManager.NewsEventsList = _objuser.GetnewseventsList();
            SessionManager.ContactUsinfo  = model;
            return(View());
        }
Beispiel #29
0
        public virtual ActionResult DeleteVideo(string id)
        {
            _objuser = new UserPresenter();

            if (!string.IsNullOrEmpty(id))
            {
                var result = _objuser.DeleteVideo(long.Parse(id));
            }
            return(RedirectToAction(MVC.Admin.VideoGalleryListView()));
        }
Beispiel #30
0
        public virtual ActionResult DeleteEventGalleryImage(string id, string eventId)
        {
            _objuser = new UserPresenter();

            if (!string.IsNullOrEmpty(id))
            {
                var result = _objuser.DeleteEventGalleryImage(long.Parse(id), long.Parse(eventId));
            }
            return(RedirectToAction(MVC.Admin.EventGalleryList()));
        }
Beispiel #31
0
 public UserController()
 {
     this.presenter = new UserPresenter();
     this.loanPresenter = new LoanPresenter();
     this._restHelper = new RestHelper();
 }