Exemple #1
0
        public pEditSponsor(DB.Sponsor currentSponsor, int? pagingStartValue = null)
        {
            this._CurrentSponsor = currentSponsor;
            if (this._CurrentSponsor == null)
            {
                throw new Exception("Sponsor cannot null");
            }

            InitializeComponent();

            if (pagingStartValue.HasValue)
                this.pagingStartValue = pagingStartValue.Value;

            Init();
        }
Exemple #2
0
        public pEditSponsor(DB.Sponsor currentSponsor, int?pagingStartValue = null)
        {
            this._CurrentSponsor = currentSponsor;
            if (this._CurrentSponsor == null)
            {
                throw new Exception("Sponsor cannot null");
            }

            InitializeComponent();

            if (pagingStartValue.HasValue)
            {
                this.pagingStartValue = pagingStartValue.Value;
            }

            Init();
        }
Exemple #3
0
 public PrintModul(PrintType dataGridInfo, dynamic detail = null)
 {
     
     this.dataGridInfo = dataGridInfo;
     PrintType ch = dataGridInfo;
     // Entscheide was gedruckt werden soll
     switch (ch)
     {
         case PrintType.Team: 
              this.CheckCSV();
              Teams teams = new Teams(detail);
              break;
         case PrintType.Sponsor:
              this.CheckCSV();
              Sponsor sponsor = new Sponsor(detail);
              break;
         case PrintType.Client:
              this.CheckCSV();
              Client customer = new Client(detail);
              break;
         case PrintType.LopOffList:
              this.CheckCSV();
              LopOffList lopOff = new LopOffList();
              break;
         case PrintType.Statistic:
              KöTaf.Utils.Printer.CSVExporter csv = new Utils.Printer.CSVExporter(detail);
              var header = csv.GetHeader();
              var content = csv.GetData();
              var csvFull = csv.GetCsv();
              csv.Write();
              try
              {
                  Libre_TeSpClConverter ooConv = new Libre_TeSpClConverter(PrintType.Statistic);  
              }
              catch (Exception ex) {
                  throw ex;
              } break;
     }
 }
 /// <summary>
 /// Veraltete Methode zum Hinzufügen eines neuen Objekts zum EntitySet 'Sponsors'. Verwenden Sie stattdessen die Methode '.Add' der zugeordneten Eigenschaft 'ObjectSet&lt;T&gt;'.
 /// </summary>
 public void AddToSponsors(Sponsor sponsor)
 {
     base.AddObject("Sponsors", sponsor);
 }
 /// <summary>
 /// Erstellt ein neues Sponsor-Objekt.
 /// </summary>
 /// <param name="sponsorID">Anfangswert der Eigenschaft SponsorID.</param>
 /// <param name="isActive">Anfangswert der Eigenschaft IsActive.</param>
 /// <param name="street">Anfangswert der Eigenschaft Street.</param>
 /// <param name="city">Anfangswert der Eigenschaft City.</param>
 /// <param name="zipCode">Anfangswert der Eigenschaft ZipCode.</param>
 /// <param name="firstName">Anfangswert der Eigenschaft FirstName.</param>
 /// <param name="lastName">Anfangswert der Eigenschaft LastName.</param>
 /// <param name="isCompany">Anfangswert der Eigenschaft IsCompany.</param>
 public static Sponsor CreateSponsor(global::System.Int32 sponsorID, global::System.Boolean isActive, global::System.String street, global::System.String city, global::System.Int32 zipCode, global::System.String firstName, global::System.String lastName, global::System.Boolean isCompany)
 {
     Sponsor sponsor = new Sponsor();
     sponsor.SponsorID = sponsorID;
     sponsor.IsActive = isActive;
     sponsor.Street = street;
     sponsor.City = city;
     sponsor.ZipCode = zipCode;
     sponsor.FirstName = firstName;
     sponsor.LastName = lastName;
     sponsor.IsCompany = isCompany;
     return sponsor;
 }
        /// <summary>
        /// Ermittelt die Anrede anhand des Geschlechts
        /// </summary>
        /// <param name="x">Sponsor</param>
        /// <returns>Anrede</returns>
        private string getSaluation(Sponsor x)
        {
            string defaultMaleTitle = IniParser.GetSetting("FORMLETTER", "defaultMaleTitle");
            string defaultFemaleTitle = IniParser.GetSetting("FORMLETTER", "defaultFemaleTitle");

            if (string.IsNullOrEmpty(x.LastName))
                return this.formletterPatternModel.saluation_n;
            else if (x != null && x.Title.Name.Equals(defaultMaleTitle))
                return this.formletterPatternModel.saluation_m;
            else if (x != null && x.Title.Name.Equals(defaultFemaleTitle))
                return this.formletterPatternModel.saluation_f;
            else
                return this.formletterPatternModel.saluation_n;
        }
Exemple #7
-16
        /// <summary>
        /// Fügt einen neuen Sponsor der Datenbank hinzu
        /// </summary>
        /// <param name="fundingTypeId">Die ID der Finanzierungsart</param>
        /// <param name="titleId">Die ID des Titels</param>
        /// <param name="firstname">Vorname</param>
        /// <param name="lastname">Nachname</param>
        /// <param name="city">Stadt</param>
        /// <param name="street">Strasse</param>
        /// <param name="zipCode">Postleitzahl</param>
        /// <param name="isFormLetterAllowed">Serienbrief erlaubt</param>
        /// <param name="contactPerson">Kontaktperson</param>
        /// <param name="email">Emailadresse</param>
        /// <param name="faxNo">Faxnummer</param>
        /// <param name="mobileNo">Handynumer</param>
        /// <param name="phoneNo">Telefonnummer</param>
        /// <returns>Die ID des Eintrags in der Datenbank</returns>
        public static int Add(int fundingTypeId, int titleId, string firstname, string lastname, string city, string street, int zipCode,
            bool isFormLetterAllowed, string companyName = null, string contactPerson = null, string email = null, string faxNo = null,
            string mobileNo = null, string phoneNo = null,bool isCompany=false)
        {
            using (TafelModelContainer db = new TafelModelContainer())
            {
                Sponsor sponsor = new Sponsor()
                {
                    CompanyName = companyName,
                    ContactPerson = contactPerson,
                    Email = email,
                    FaxNo = faxNo,
                    FirstName = firstname,
                    LastName = lastname,
                    MobileNo = mobileNo,
                    PhoneNo = phoneNo,
                    Street = street,
                    ZipCode = zipCode,
                    _IsFormLetterAllowed = isFormLetterAllowed,
                    City = city,
                    IsActive = true,
                    IsCompany=isCompany,
                    Title = db.Titles.Single(t => t.TitleID == titleId),
                    FundingType = db.FundingTypes.Single(f => f.FundingTypeID == fundingTypeId),
                };

                db.Sponsors.AddObject(sponsor);
                db.SaveChanges();

                return sponsor.SponsorID;
            }
        }