Ejemplo n.º 1
0
        public async Task <bool> PostDonation(decimal amount)
        {
            Donations donation = new Donations();

            donation.Username       = token.username;
            donation.Amount         = amount;
            donation.TimeStamp      = DateTime.Now;
            donation.OrganizationId = 1;

            var json        = JsonConvert.SerializeObject(donation);
            var httpContent = new StringContent(json, Encoding.UTF8, "application/json");
            var httpClient  = new HttpClient(SSLHelper.GetSSL());

            httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + token.token);
            var response = await httpClient.PostAsync(configuration.GetConnectionString("PostDonationService"), httpContent);

            //var responseString = await response.Content.ReadAsStringAsync();

            if (response.StatusCode == HttpStatusCode.Created)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync()
        {
            if (string.IsNullOrEmpty(Request.Cookies["Token"]))
            {
                return(Redirect("/"));
            }


            LastMessage = "";

            Donation = new GanjoorDonationViewModel()
            {
                RecordDate = DateTime.Now.Date,
                Unit       = "تومان"
            };

            await ReadDonations();

            if (!string.IsNullOrEmpty(Request.Query["id"]))
            {
                var donation = Donations.Where(d => d.Id == int.Parse(Request.Query["id"])).Single();
                if (donation != null)
                {
                    int rowNumber = Donations.Length - Array.IndexOf(Donations, donation);
                    EmailContent = $"با درود و سپاس از بزرگواری شما{Environment.NewLine}" +
                                   $"کمک دریافتی به شماره ردیف {rowNumber.ToPersianNumbers()} در این نشانی ثبت شد:{Environment.NewLine}" +
                                   $"https://ganjoor.net/donate{Environment.NewLine}" +
                                   $"نحوهٔ هزینه شدن آن متعاقباً در همان ردیف مستند خواهد شد.{Environment.NewLine}" +
                                   $"سرافراز باشید.";
                }
            }

            return(Page());
        }
Ejemplo n.º 3
0
        private void FilterDataGrid()
        {
            IEnumerable <BloodDonation> temporaryFilteredDonations = Donations.AsEnumerable();

            var bloodType       = BloodTypeComboBox.SelectedItem;
            var donorPesel      = DonorPeselTextBox.Text;
            var bloodTakerPesel = BloodTakerTextBox.Text;

            if (bloodType != null)
            {
                temporaryFilteredDonations =
                    temporaryFilteredDonations.Where(x => x.BloodType.ToString() == bloodType.ToString());
            }
            if (donorPesel != "")
            {
                temporaryFilteredDonations =
                    temporaryFilteredDonations.Where(x => x.Donor.Pesel.Contains(donorPesel));
            }
            if (bloodTakerPesel != "")
            {
                temporaryFilteredDonations =
                    temporaryFilteredDonations.Where(x => x.BloodTaker.Pesel.Contains(bloodTakerPesel));
            }

            FilteredDonations.Clear();
            foreach (var temporaryFilteredDonation in temporaryFilteredDonations)
            {
                FilteredDonations.Add(temporaryFilteredDonation);
            }
        }
Ejemplo n.º 4
0
        private void LoadData()
        {
            Donations.Add(new CollectionItem(typeof(Silver), 0xEF2, 1017384, 0x0, 1));

            Rewards.Add(new FactionCollectionItem(typeof(StrongholdRune), 0x1F14, 1094700, 0, this.Faction, 150, 0));
            Rewards.Add(new FactionCollectionItem(typeof(ShrineGem), 0x1EA7, 1094711, 0, this.Faction, 100, 0));
            Rewards.Add(new FactionCollectionItem(typeof(SupernovaPotion), 3849, 1094718, 13, this.Faction, 100, 0));
            Rewards.Add(new FactionCollectionItem(typeof(GreaterStaminaPotion), 3849, 1094764, 437, this.Faction, 50, 0));
            Rewards.Add(new FactionCollectionItem(typeof(EnchantedBandage), 0xE21, 1094712, 0, this.Faction, 100, 0));
            Rewards.Add(new FactionCollectionItem(typeof(PowderOfPerseverance), 4102, 1094712, 2419, this.Faction, 300, 0));
            Rewards.Add(new FactionCollectionItem(typeof(MorphEarrings), 0x1087, 1094746, 0, this.Faction, 1000, 0));

            Rewards.Add(new FactionCollectionItem(typeof(PrimerOnArmsTalisman), 12121, 1094704, 0, this.Faction, 3000, 7));
            Rewards.Add(new FactionCollectionItem(typeof(ClaininsSpellbook), 3834, 1094705, 0x84D, this.Faction, 4000, 9));
            Rewards.Add(new FactionCollectionItem(typeof(CrimsonCincture), 5435, 1075043, 0x485, this.Faction, 2000, 4));
            Rewards.Add(new FactionCollectionItem(typeof(CrystallineRing), 4234, 1075096, 1152, this.Faction, 4000, 9));
            Rewards.Add(new FactionCollectionItem(typeof(HumanFeyLeggings), 5054, 1075041, 0, this.Faction, 1000, 1));
            Rewards.Add(new FactionCollectionItem(typeof(FoldedSteelGlasses), 12216, 1073380, 1150, this.Faction, 4000, 9));
            Rewards.Add(new FactionCollectionItem(typeof(HeartOfTheLion), 5141, 1070817, 1281, this.Faction, 2000, 4));
            Rewards.Add(new FactionCollectionItem(typeof(HuntersHeaddress), 5447, 1061595, 1428, this.Faction, 2000, 4));
            Rewards.Add(new FactionCollectionItem(typeof(KasaOfTheRajin), 10136, 1070969, 0, this.Faction, 1000, 1));
            Rewards.Add(new FactionCollectionItem(typeof(MaceAndShieldGlasses), 12216, 1073381, 477, this.Faction, 5000, 10));
            Rewards.Add(new FactionCollectionItem(typeof(VesperOrderShield), 7108, 1073258, 0, this.Faction, 4000, 9));
            Rewards.Add(new FactionCollectionItem(typeof(OrnamentOfTheMagician), 4230, 1061105, 1364, this.Faction, 5000, 10));
            Rewards.Add(new FactionCollectionItem(typeof(RingOfTheVile), 4234, 1061102, 1271, this.Faction, 2000, 4));
            Rewards.Add(new FactionCollectionItem(typeof(RuneBeetleCarapace), 10109, 1070968, 0, this.Faction, 1000, 1));
            Rewards.Add(new FactionCollectionItem(typeof(SpiritOfTheTotem), 5445, 1061599, 1109, this.Faction, 3000, 7));
            Rewards.Add(new FactionCollectionItem(typeof(Stormgrip), 10130, 1070970, 0, this.Faction, 1000, 1));
            Rewards.Add(new FactionCollectionItem(typeof(InquisitorsResolution), 5140, 1060206, 1266, this.Faction, 5000, 10));
            Rewards.Add(new FactionCollectionItem(typeof(TomeOfLostKnowledge), 3834, 1070971, 1328, this.Faction, 3000, 7));
            Rewards.Add(new FactionCollectionItem(typeof(WizardsCrystalGlasses), 4102, 1094756, 0, this.Faction, 3000, 7));
        }
Ejemplo n.º 5
0
        public async Task <ActionResult <Donations> > PostDonations(Donations donations)
        {
            _context.donations.Add(donations);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDonations", new { id = donations.id }, donations));
        }
Ejemplo n.º 6
0
 public static bool RemoveDonation(Donations d)
 {
     using (DAL.Charity_DBEntities db = new DAL.Charity_DBEntities())
     {
         db.Donations.Remove(BL.Converters.DonationConverter.convertToDAL(d));
         try
         {
             db.SaveChanges();
             return(true);
         }
         catch (DbEntityValidationException ex)
         {
             foreach (var entityValidationErrors in ex.EntityValidationErrors)
             {
                 foreach (var validationError in entityValidationErrors.ValidationErrors)
                 {
                     System.Diagnostics.Debug.WriteLine(
                         "Property: " + validationError.PropertyName + " Error: " + validationError.ErrorMessage);
                 }
             }
             System.Diagnostics.Debug.WriteLine("no");
             return(false);
         }
     }
 }
Ejemplo n.º 7
0
    /// <summary>
    /// Returns complete where condition according to current property values.
    /// </summary>
    private string GetCompleteWhereCondition()
    {
        // Get only order items for current site
        var where = SqlHelper.AddWhereCondition(null, "COM_Order.OrderSiteID = " + SiteContext.CurrentSiteID);

        // Get only order items from paid orders
        if (DisplayOnlyPaidDonations)
        {
            where = SqlHelper.AddWhereCondition(where, "COM_Order.OrderIsPaid = 1");
        }

        // Get only public/private donations
        switch (Donations.ToUpperCSafe())
        {
            case "PUBLIC":
                where = SqlHelper.AddWhereCondition(where, "COM_OrderItem.OrderItemIsPrivate = 0");
                break;

            case "PRIVATE":
                where = SqlHelper.AddWhereCondition(where, "COM_OrderItem.OrderItemIsPrivate = 1");
                break;
        }

        // Add additional where condition
        if (!String.IsNullOrEmpty(WhereCondition))
        {
            where = SqlHelper.AddWhereCondition(where, WhereCondition);
        }

        return where;
    }
Ejemplo n.º 8
0
        public async void DisplayDonationAsync()
        {
            var httpClient  = new HttpClient();
            var accessToken = await SecureStorage.GetAsync(Constants.AccessToken) ?? throw new Exception("Access token not found");

            if (accessToken == null)
            {
                _result = await client.LoginAsync(new LoginRequest());

                if (_result.IsError)
                {
                    ErrorMessage = _result.Error;
                    return;
                }
                accessToken = _result.AccessToken;
                await SecureStorage.SetAsync(Constants.AccessToken, accessToken);
            }
            if (httpClient.DefaultRequestHeaders.Authorization == null)
            {
                httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
            }

            var uri       = new Uri($"{current}/api/Admin/donation/{eventId}");
            var donations = await httpClient.GetFromJsonAsync <IEnumerable <DtoDonation> >(uri);

            foreach (var donation in donations)
            {
                Donations.Add(donation);
                Console.WriteLine(Donations.Count);
            }
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Email,Wallet,Usertype,Amount,DonateTime")] Donations donations)
        {
            if (id != donations.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(donations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DonationsExists(donations.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(donations));
        }
Ejemplo n.º 10
0
        public void All()
        {
            var members = new Members(databaseProvider);
            Member member = CreateAliceWithPhoneNumber();
            member = members.Insert(member);
            var donations = new Donations(databaseProvider);
            donations.Insert(new Donation {MemberId = member.Id, Amount = 12.50m, Date = DateTime.Today});
            donations.Insert(new Donation { MemberId = member.Id, Amount = 12.50m, Date = DateTime.Today.Subtract(TimeSpan.FromDays(1)) });

            var list = members.GetAll().ToList();
            Assert.IsNotNull(list);
            Assert.AreEqual(1, list.Count);
            member = list.FirstOrDefault();
            Assert.IsNotNull(member);
            Assert.AreEqual("ABC", member.Reference);
            Assert.AreEqual("Ms", member.Title);
            Assert.AreEqual("Alice", member.FirstName);
            Assert.AreEqual("Krige", member.LastName);
            Assert.AreEqual("Alice", member.Salutation);
            Assert.AreEqual("*****@*****.**", member.EmailAddress);
            Assert.AreEqual("Dunassimilatin", member.AddressLine1);
            Assert.AreEqual("Sector 4", member.AddressLine2);
            Assert.AreEqual("Nexus One", member.City);
            Assert.AreEqual("Delta Quadrant", member.Region);
            Assert.AreEqual("Wales", member.Country);
            Assert.AreEqual("CA1 0PP", member.PostalCode);
            Assert.AreEqual(25m, member.TotalDonations);

            Assert.AreEqual(1, member.PhoneNumbers.Count);
            PhoneNumber phone = member.PhoneNumbers.First();
            Assert.AreEqual(member.Id, phone.MemberId);
            Assert.AreEqual(PhoneNumberType.Home, phone.PhoneNumberType);
            Assert.AreEqual("01234 567890", phone.Number);
        }
Ejemplo n.º 11
0
        private void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                int donationId = int.Parse(textBox1.Text.ToString());


                Donations k = new Donations();



                int result = k.DeleteDonation(donationId);
                if (result > 0)
                {
                    label2.Text = "Donation deleted";
                }
                else
                {
                    label2.Text = "Donation Not deleted";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 12
0
        //private static Donations donations;
        public static int AddDonations(Donations d)
        {
            //donations = d;
            using (DAL.Charity_DBEntities db = new DAL.Charity_DBEntities())
            {
                // if (d.MasterCategory == 0) d.MasterCategory = null;
                //מוסיפים תמיד?
                db.Donations.Add(Converters.DonationConverter.convertToDAL(d));
                try
                {
                    db.SaveChanges();
                    int code = db.Donations.ToArray().Last().donationCode;
                    d.donationCode = code;
                    BL.EmailService.SendMail("תרומתך התקבלה", code + "מספר התרומה", d.donorEmail);
                    CoordinationDonation(d);
                    return(code);

                    //שליחת מייל
                }
                catch (DbEntityValidationException ex)
                {
                    foreach (var entityValidationErrors in ex.EntityValidationErrors)
                    {
                        foreach (var validationError in entityValidationErrors.ValidationErrors)
                        {
                            System.Diagnostics.Debug.WriteLine(
                                "Property: " + validationError.PropertyName + " Error: " + validationError.ErrorMessage);
                        }
                    }
                    System.Diagnostics.Debug.WriteLine("no");
                    return(0);
                }
            }
        }
Ejemplo n.º 13
0
        }//פונקציה שמקבלת קוד תרומה ומחזירה את אותה תרומה

        public static bool RemoveDonation(Donations d)//פונקציה שמקבלת תרומה ומוחקת אותה מטבלת בתרומות
        {
            using (DAL.Charity_DBEntities db = new DAL.Charity_DBEntities())
            {
                if (d != null)
                {
                    db.DonationOffers.RemoveRange(db.DonationOffers.Where(d1 => d.donationCode == d1.DonationCode).ToList());
                    db.Donations.Remove(db.Donations.FirstOrDefault(d1 => d.donationCode == d1.donationCode));
                }
                try
                {
                    db.SaveChanges();
                    return(true);
                }
                catch (DbEntityValidationException ex)
                {
                    foreach (var entityValidationErrors in ex.EntityValidationErrors)
                    {
                        foreach (var validationError in entityValidationErrors.ValidationErrors)
                        {
                            System.Diagnostics.Debug.WriteLine(
                                "Property: " + validationError.PropertyName + " Error: " + validationError.ErrorMessage);
                        }
                    }
                    System.Diagnostics.Debug.WriteLine("no");
                    return(false);
                }
            }
        }
Ejemplo n.º 14
0
        public void SaveDonation()
        {
            try
            {
                using (ShelterDatabaseLINQDataContext db = new ShelterDatabaseLINQDataContext())
                {
                    Donations donation = new Donations
                    {
                        DonatorID    = DonatorID,
                        DonationName = DonationName,
                        Description  = Description,
                        Amount       = Amount,
                        Date         = Date
                    };
                    db.Donations.InsertOnSubmit(donation);
                    db.SubmitChanges();

                    ID = donation.ID;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 15
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Donations.Clear();
                Image   = String.Empty;
                Content = String.Empty;
                DonationTitles.Clear();
                var items = await DonationStore.GetItemsAsync("api/donations", true);

                if (items != null && items.Count() > 0)
                {
                    foreach (var item in items)
                    {
                        Donations.Add(item);
                        DonationTitles.Add(item.Title);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 16
0
        public virtual ProcessedOrganisation Build(Organisation organisation)
        {
            var body = _markdownWrapper.ConvertToHtml(organisation.AboutUs ?? "");

            var volunteering = new Volunteering
            {
                Email              = organisation.Email,
                VolunteeringText   = organisation.VolunteeringText,
                VolunteeringNeeded = organisation.Volunteering,
                Url  = $"organisations/{organisation.Slug}",
                Type = "organisation"
            };

            var donations = new Donations()
            {
                Email        = organisation.Email,
                GetDonations = organisation.Donations,
                Url          = $"groups/{organisation.Slug}"
            };

            var groupsWithFavourites = cookiesHelper.PopulateCookies(organisation.Groups, "favourites");

            return(new ProcessedOrganisation(organisation.Title, organisation.Slug, organisation.ImageUrl, body, organisation.Phone,
                                             organisation.Email, groupsWithFavourites, volunteering, donations));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Donations donations = db.Donations.Find(id);

            db.Donations.Remove(donations);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 18
0
 public void SetInformations(Donations donation)
 {
     DonationName = donation.DonationName;
     Description  = donation.Description;
     Amount       = donation.Amount;
     DonatorID    = donation.DonatorID;
     Date         = donation.Date;
 }
Ejemplo n.º 19
0
        public override void Init()
        {
            base.Init();

            Donations.Add(new CollectionItem(typeof(Gold), 0xEEF, 1073116, 0x0, 0.06666));
            Donations.Add(new CollectionItem(typeof(BankCheck), 0x14F0, 1075013, 0x34, 0.06666));
            Donations.Add(new CollectionItem(typeof(BrownBook), 0xFEF, 1074906, 0x0, 3));
            Donations.Add(new CollectionItem(typeof(TanBook), 0xFF0, 1074906, 0x0, 3));
            Donations.Add(new CollectionItem(typeof(IronIngot), 0x1BF2, 1074904, 0x0, 1));
            Donations.Add(new CollectionItem(typeof(DullCopperIngot), 0x1BF2, 1074916, 0x973, 2));
            Donations.Add(new CollectionItem(typeof(ShadowIronIngot), 0x1BF2, 1074917, 0x966, 4));
            Donations.Add(new CollectionItem(typeof(CopperIngot), 0x1BF2, 1074918, 0x96D, 8));
            Donations.Add(new CollectionItem(typeof(BronzeIngot), 0x1BF2, 1074919, 0x972, 12));
            Donations.Add(new CollectionItem(typeof(GoldIngot), 0x1BF2, 1074920, 0x8A5, 18));
            Donations.Add(new CollectionItem(typeof(AgapiteIngot), 0x1BF2, 1074921, 0x979, 24));
            Donations.Add(new CollectionItem(typeof(VeriteIngot), 0x1BF2, 1074922, 0x89F, 31));
            Donations.Add(new CollectionItem(typeof(ValoriteIngot), 0x1BF2, 1074923, 0x8AB, 39));
            Donations.Add(new CollectionItem(typeof(Leather), 0x1081, 1074929, 0x0, 2));
            Donations.Add(new CollectionItem(typeof(SpinedLeather), 0x1081, 1074930, 0x8AC, 5));
            Donations.Add(new CollectionItem(typeof(HornedLeather), 0x1081, 1074931, 0x845, 10));
            Donations.Add(new CollectionItem(typeof(BarbedLeather), 0x1081, 1074932, 0x851, 15));
            Donations.Add(new CollectionItem(typeof(Hides), 0x1079, 1074924, 0x0, 2));
            Donations.Add(new CollectionItem(typeof(SpinedLeather), 0x1079, 1074925, 0x8AC, 5));
            Donations.Add(new CollectionItem(typeof(HornedLeather), 0x1079, 1074926, 0x845, 10));
            Donations.Add(new CollectionItem(typeof(BarbedLeather), 0x1079, 1074927, 0x851, 15));


            int[] hues = new int[] { 0x1E0, 0x190, 0x151 };
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendBodySash), 0x1541, 1073346, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendFeatheredHat), 0x171A, 1073347, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendSurcoat), 0x1FFD, 1073348, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendPants), 0x1539, 1073349, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendCloak), 0x1515, 1073350, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendDoublet), 0x1F7B, 1073351, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendSkirt), 0x1537, 1073352, 0x190, 100000.0, hues));
            Rewards.Add(new CollectionTitle(1073341, 1073859, 100000.0));                 // Britain Public Library Contributor

            hues = new int[] { 0x0, 0x1C2, 0x320, 0x190, 0x1E0 };
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendLantern), 0xA25, 1073339, 0x1C2, 200000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(LibraryFriendReadingChair), 0x2DEB, 1073340, 0x1C2, 200000.0, hues));
            Rewards.Add(new CollectionTitle(1073342, 1073860, 200000.0));                 // Distinguished Library Contributor
            Rewards.Add(new CollectionHuedItem(typeof(SherryTheMouseQuotes), 0xFBD, 1073300, 0x1C2, 350000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(WyrdBeastmasterQuotes), 0xFBD, 1073310, 0x1C2, 350000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(MercenaryJustinQuotes), 0xFBD, 1073317, 0x1C2, 350000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(HeigelOfMoonglowQuotes), 0xFBD, 1073327, 0x1C2, 350000.0, hues));
            Rewards.Add(new CollectionHuedItem(typeof(TraderHoraceQuotes), 0xFBD, 1073338, 0x1C2, 350000.0, hues));
            Rewards.Add(new CollectionTitle(1073343, 1073861, 350000.0));                 // Honored Library Contributor
            Rewards.Add(new CollectionItem(typeof(TreatiseonAlchemyTalisman), 0x2F58, 1073353, 0x0, 550000.0));
            Rewards.Add(new CollectionItem(typeof(PrimerOnArmsTalisman), 0x2F59, 1073354, 0x0, 550000.0));
            Rewards.Add(new CollectionItem(typeof(MyBookTalisman), 0x2F5A, 1073355, 0x0, 550000.0));
            Rewards.Add(new CollectionItem(typeof(TalkingtoWispsTalisman), 0x2F5B, 1073356, 0x0, 550000.0));
            Rewards.Add(new CollectionItem(typeof(GrammarOfOrchishTalisman), 0x2F59, 1073358, 0x0, 550000.0));
            Rewards.Add(new CollectionItem(typeof(BirdsofBritanniaTalisman), 0x2F5A, 1073359, 0x0, 550000.0));
            Rewards.Add(new CollectionItem(typeof(TheLifeOfTravelingMinstrelTalisman), 0x2F5A, 1073360, 0x0, 550000.0));
            Rewards.Add(new CollectionTitle(1073344, 1073862, 550000.0));                 // Prominent Library Contributor
            Rewards.Add(new CollectionTitle(1073345, 1073863, 800000.0));                 // Eminent Library Contributor
            Rewards.Add(new CollectionItem(typeof(TradesGlasses), 0x2FB8, 1073362, 0x0, 800000.0));
        }
Ejemplo n.º 20
0
        public Donation DonateNgo(Guid id, Ngo ngo, decimal value, string hash)
        {
            Donate(value);
            var donation = new Donation(id, this, ngo, value, "ngo", hash);

            Donations.Add(donation);

            return(donation);
        }
Ejemplo n.º 21
0
        public Donation DonateChild(Guid id, Ngo ngo, Guid childId, decimal value, string hash)
        {
            Donate(value);
            var donation = new Donation(id, this, ngo, childId, value, "child", hash);

            Donations.Add(donation);

            return(donation);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Returns true if ClanMember instances are equal
        /// </summary>
        /// <param name="input">Instance of ClanMember to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ClanMember?input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     League == input.League ||
                     (League != null &&
                      League.Equals(input.League))
                     ) &&
                 (
                     Tag == input.Tag ||
                     (Tag != null &&
                      Tag.Equals(input.Tag))
                 ) &&
                 (
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                 ) &&
                 (
                     Role == input.Role ||
                     Role.Equals(input.Role)
                 ) &&
                 (
                     ExpLevel == input.ExpLevel ||
                     ExpLevel.Equals(input.ExpLevel)
                 ) &&
                 (
                     ClanRank == input.ClanRank ||
                     ClanRank.Equals(input.ClanRank)
                 ) &&
                 (
                     PreviousClanRank == input.PreviousClanRank ||
                     PreviousClanRank.Equals(input.PreviousClanRank)
                 ) &&
                 (
                     Donations == input.Donations ||
                     Donations.Equals(input.Donations)
                 ) &&
                 (
                     DonationsReceived == input.DonationsReceived ||
                     DonationsReceived.Equals(input.DonationsReceived)
                 ) &&
                 (
                     Trophies == input.Trophies ||
                     Trophies.Equals(input.Trophies)
                 ) &&
                 (
                     VersusTrophies == input.VersusTrophies ||
                     VersusTrophies.Equals(input.VersusTrophies)
                 ));
        }
 public ActionResult Edit([Bind(Include = "ID,firstName,lastName,address,city,state,country,donation")] Donations donations)
 {
     if (ModelState.IsValid)
     {
         db.Entry(donations).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(donations));
 }
Ejemplo n.º 24
0
 public ActionResult Edit([Bind(Include = "Id,Date,Department_Id,Full_Name,Total_Amount,Anonymity")] Donations donations)
 {
     if (ModelState.IsValid)
     {
         db.Entry(donations).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Admin"));
     }
     ViewBag.Department_Id = new SelectList(db.Departments, "Id", "Name", donations.Department_Id);
     return(View(donations));
 }
 public void ExportPDF()
 {
     if (Donations != null && Donations.Count() != 0)
     {
         DocumentManager.ExportDataPDF(DonationInfo.ConvertToList(Donations), "Export zvířata");
     }
     else
     {
         MessageBox.Show("Žádná data pro export.");
     }
 }
        public ActionResult Create([Bind(Include = "ID,firstName,lastName,address,city,state,country,donation")] Donations donations)
        {
            if (ModelState.IsValid)
            {
                db.Donations.Add(donations);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(donations));
        }
Ejemplo n.º 27
0
        public async Task <IActionResult> Create([Bind("Id,Email,Wallet,Usertype,Amount,DonateTime")] Donations donations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(donations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(donations));
        }
Ejemplo n.º 28
0
        public ActionResult <Donations> UpdateDonation(string id, [FromBody] Donations donations)
        {
            var DonationCheck = _donationsService.GetDonation(id);

            if (DonationCheck == null)
            {
                return(NotFound());
            }

            _donationsService.UpdateDonation(id, donations);
            return(NoContent());
        }
Ejemplo n.º 29
0
 private void LISTToolStripMenuItem4_Click(object sender, EventArgs e)
 {
     try
     {
         Donations p = new Donations();
         dgvDonors.DataSource = p.ListDonations();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void UpdateDonation_Load(object sender, EventArgs e)
        {
            Donations D = new Donations();

            dc            = new DonationsController();
            D             = dc.GetDonationsByID(ID);
            textBox5.Text = D.Sno.ToString();
            textBox1.Text = D.Name;
            textBox2.Text = D.Amount;
            textBox3.Text = D.Branch;
            textBox4.Text = D.UsedFor;
        }
Ejemplo n.º 31
0
 public ProcessedOrganisation(string title, string slug, string imageUrl, string aboutUs, string phone,
                              string email, List <Group> groups, Volunteering volunteering, Donations donations)
 {
     Title        = title;
     Slug         = slug;
     Phone        = phone;
     Email        = email;
     AboutUs      = aboutUs;
     ImageUrl     = imageUrl;
     Volunteering = volunteering;
     Groups       = groups;
     Donations    = donations;
 }