Exemplo n.º 1
0
        public JsonResult DeleteDonations(int DonationId)
        {
            Donationservice.Delete(DonationId);
            var data = GenericMetodsservices.GetAdminDonations();

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult CreateDonation(DonationModel AdminDonationModel, HttpPostedFileBase BannerImage)
        {
            DonationModel DonationCreation = new DonationModel();

            if (ModelState.IsValid)
            {
                var fileName = Path.GetFileName(BannerImage.FileName);
                var path     = Path.Combine(Server.MapPath("~/UserProfilePictures/" + fileName));
                BannerImage.SaveAs(path);
                var FilePath = "/UserProfilePictures/" + fileName;


                Donation_Details Donations = new Donation_Details()
                {
                    Donation_Title       = AdminDonationModel.DonationTitle,
                    Donation_Banner      = FilePath,
                    Donation_Description = AdminDonationModel.DonationDescription,
                    Donation_Amount      = AdminDonationModel.DonationAmount,
                    Status    = true,
                    CreatedOn = DateTime.Now
                };

                Donation_Details AdminDonations = Donationservice.Create(Donations);
            }

            return(RedirectToAction("GetDonations"));
        }
Exemplo n.º 3
0
        public ActionResult UpdateDonation(DonationModel AdminDonationModel, HttpPostedFileBase BannerImage)
        {
            if (AdminDonationModel.DonationID != null)
            {
                var FilePath = "";
                if (BannerImage != null)
                {
                    var fileName = Path.GetFileName(BannerImage.FileName);
                    var path     = Path.Combine(Server.MapPath("~/UserProfilePictures/" + fileName));
                    BannerImage.SaveAs(path);
                    FilePath = "/UserProfilePictures/" + fileName;
                }

                Donation_Details Donations = new Donation_Details()
                {
                    Donation_ID          = AdminDonationModel.DonationID,
                    Donation_Title       = AdminDonationModel.DonationTitle,
                    Donation_Description = AdminDonationModel.DonationDescription,
                    Donation_Amount      = AdminDonationModel.DonationAmount,
                    Donation_Banner      = FilePath,
                    Status    = true,
                    UpdatedOn = DateTime.Now
                };
                Donationservice.DonationsUpdate(Donations);
            }

            else
            {
            }
            TempData["SuccessMessage"] = "Donation Updated Successfully..";
            return(RedirectToAction("GetDonations", "Donations", new { area = "Admin" }));
        }
Exemplo n.º 4
0
        public ActionResult DonationDetails(int DonationId)
        {
            List <Donations> data = Donationservice.GetDonationDetails(DonationId);

            return(View(data));
        }
Exemplo n.º 5
0
        public JsonResult GetDonationDetails()
        {
            var data = Donationservice.GetDonations();

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public ActionResult DonorDonations(int DonorId)
        {
            List <Donor_Details> data = Donationservice.UserDonationReport(DonorId);

            return(View(data));
        }
Exemplo n.º 7
0
        public ActionResult DonationReport()
        {
            List <Donor_Details> data = Donationservice.AdminDonationReport();

            return(View(data));
        }