예제 #1
0
        /// <summary>
        /// Erstellt eine neue Zulassung.
        /// </summary>
        /// <param name="carOwnerId">Id des Halters.</param>
        /// <param name="vehicleId">Id des Fahrzeugs.</param>
        /// <param name="licencenumber">Kennzeichen für die Zulassung.</param>
        /// <param name="evbNumber">eVB-Nummer der Fahrzeugversicherung.</param>
        /// <param name="generalInspectionDate">Datum der Hauptuntersuchung (HU).</param>
        /// <param name="registrationDate">Zulassungsdatum.</param>
        /// <param name="registrationDocumentNumber">Fahrzeugbriefnummer, falls vorhanden.</param>
        /// <param name="dbContext">Datenbankkontext für die Transaktion.</param>
        /// <returns>Die neue Zulassung.</returns>
        public static Registration CreateRegistration(CarOwner carOwner, Vehicle vehicle, string licencenumber, string evbNumber, DateTime? generalInspectionDate, 
            DateTime? registrationDate, string registrationDocumentNumber, string emissionCode, DataClasses1DataContext dbContext)
        {
            Registration registration = new Registration()
            {
                Vehicle = vehicle,
                CarOwner = carOwner,
                Licencenumber = licencenumber,
                GeneralInspectionDate = generalInspectionDate,
                RegistrationDate = registrationDate,
                RegistrationDocumentNumber = registrationDocumentNumber,
                eVBNumber = evbNumber,
                EmissionCode = emissionCode
            };

            dbContext.Registration.InsertOnSubmit(registration);
            dbContext.SubmitChanges();
            dbContext.WriteLogItem("Zulassung wurde angelegt.", LogTypes.INSERT, registration.Id, "Registration", vehicle.Id);

            return registration;
        }
예제 #2
0
파일: CarOwner.cs 프로젝트: HedinRakot/KVS
        /// <summary>
        /// Erstelle einen neuen Fahrzeughalter
        /// </summary>
        /// <param name="name">Nachname</param>
        /// <param name="firstName">Vorname</param>
        /// <param name="bankAccountId">ID der Bankverbindung</param>
        /// <param name="contactId">ID des Kontaktdatensatzes</param>
        /// <param name="adressId">ID der Adresse</param>
        /// <param name="dbContext">DB Kontext</param>
        /// <returns>CarOwner</returns>
        public static CarOwner CreateCarOwner(string name, string firstName, BankAccount bankAccount, Contact contact, Adress adress, DataClasses1DataContext dbContext)
        {
            if (string.IsNullOrEmpty(name))
            {
                ////throw new Exception("Der Name des Halters darf nicht leer sein.");
            }

            CarOwner owner = new CarOwner()
            {
                Name = name,
                FirstName = firstName,
                BankAccount = bankAccount,
                Contact = contact,
                Adress = adress
            };

            dbContext.CarOwner.InsertOnSubmit(owner);
            dbContext.SubmitChanges();
            dbContext.WriteLogItem("Halter " + name + " wurde angelegt.", LogTypes.INSERT, owner.Id, "CarOwner");
            return owner;
        }
예제 #3
0
		private void detach_CarOwner(CarOwner entity)
		{
			this.SendPropertyChanging();
			entity.BankAccount = null;
		}
예제 #4
0
		private void detach_CarOwner(CarOwner entity)
		{
			this.SendPropertyChanging();
			entity.Adress = null;
		}
예제 #5
0
		private void attach_CarOwner(CarOwner entity)
		{
			this.SendPropertyChanging();
			entity.Adress = this;
		}
예제 #6
0
 partial void DeleteCarOwner(CarOwner instance);
예제 #7
0
 partial void UpdateCarOwner(CarOwner instance);
예제 #8
0
 partial void InsertCarOwner(CarOwner instance);