示例#1
0
        public void Update(int type, string leaseTitle, string leaseDesc, DateTime startDate, DateTime endDate, LeaseTerm term,
                           string rentFrequency, decimal rentAmount, string rentDueOn, decimal damageDeposit, decimal petDisposit, DateTime signDate,
                           bool isActive, bool addudum, int endCode, string renewTerm, string notes, RentCoverage rentCoverage)
        {
            Type                = type;
            LeaseTitle          = leaseTitle;
            LeaseDesc           = LeaseDesc;
            LeaseStartDate      = startDate;
            LeaseEndDate        = endDate;
            Term                = term;
            RentFrequency       = rentFrequency;
            RentAmount          = rentAmount;
            RentDueOn           = rentDueOn;
            DamageDepositAmount = damageDeposit;
            PetDepositAmount    = petDisposit;
            LeaseSignDate       = signDate;
            IsActive            = isActive;
            IsAddendumAvailable = addudum;
            EndLeaseCode        = endCode;
            RenewTerm           = renewTerm;
            Modified            = DateTime.Now;
            RentCoverage        = rentCoverage;
            Notes               = notes;


            if (type == 1)
            {
                isActive = false;
            }
        }
示例#2
0
 private void SetLeaseTermInactive(LeaseTerm lease)
 {
     lease.IsActive = false;
     foreach (var application in lease.LeaseApplications)
     {
         if (application.LeaseApplicationStatusId == 1)
         {
             application.LeaseApplicationStatusId = 4;
         }
     }
 }
示例#3
0
        public bool CreateLeaseTerm(int ownerId, LeaseTermModel term)
        {
            var prop = Entities.Properties.Find(term.PropertyId);

            if (prop != null && prop.OwnerId == ownerId)
            {
                var termDb = new LeaseTerm
                {
                    PropertyId  = term.PropertyId,
                    Description = term.Description,
                    Duration    = term.Duration,
                    MonthlyRent = term.MonthlyRent,
                    IsActive    = term.IsActive
                };
                Entities.LeaseTerms.Add(termDb);
                Entities.SaveChanges();
                return(true);
            }
            return(false);
        }
示例#4
0
        public Lease(int type, string leaseTitle, string leaseDesc, int rentalPropertyId,
                     DateTime leaseStartDate, DateTime leaseEndDate, LeaseTerm term,
                     string rentFrequency, decimal rentAmount, string rentDueOn,
                     decimal damageDepositAmount, decimal?petDepositAmount, DateTime leaseSignDate,
                     string leaseAgreementDocUrl, bool isActive, bool isAddendumAvailable, int endCode,
                     string notes, DateTime creationDate, DateTime updateDate, string renewTerm,
                     RentCoverage rentCoverage, /*Addendum addendum,*/ ICollection <Agent> agent, ICollection <Tenant> tenant)
        {
            Type                 = type;
            LeaseTitle           = leaseTitle;
            LeaseDesc            = leaseDesc;
            RentalPropertyId     = rentalPropertyId;
            LeaseStartDate       = leaseStartDate;
            LeaseEndDate         = leaseEndDate;
            Term                 = term;
            RentFrequency        = rentFrequency;
            RentAmount           = rentAmount;
            RentDueOn            = rentDueOn;
            DamageDepositAmount  = damageDepositAmount;
            PetDepositAmount     = petDepositAmount;
            LeaseSignDate        = leaseSignDate;
            LeaseAgreementDocUrl = leaseAgreementDocUrl;
            IsActive             = isActive;
            IsAddendumAvailable  = isAddendumAvailable;
            EndLeaseCode         = endCode;   // 1: renew month by month, 21: renew by other term, 3: fixed term, 31. fixed term with renew of month by month or new term 32: fixed term and vacant, 0: n/a
            RenewTerm            = renewTerm; // could be used as vacant reason
            Notes                = notes;

            Created  = creationDate;
            Modified = updateDate;

            RentCoverage = rentCoverage;
            //Addendum = addendum;
            Agent  = agent;
            Tenant = tenant;
        }
示例#5
0
 public static LeaseTermModel ToServiceModel(this LeaseTerm term)
 {
     return(Mapper.Map <LeaseTerm, LeaseTermModel>(term));
 }
示例#6
0
 public static LeaseTermModelExtended ToServiceModelExtended(this LeaseTerm leaseTerm)
 {
     return(Mapper.Map <LeaseTerm, LeaseTermModelExtended>(leaseTerm));
 }
示例#7
0
        private void Save_btn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string  value    = amount_textBox.Text.Replace(",", "").Replace("$", "").TrimStart('0');
                LeasesP newLease = new LeasesP();

                newLease.LeaseID = int.Parse(leaseID_textbox.Text);

                newLease.ContractDate = contractDate.SelectedDate.Value;

                newLease.FirstPaymentDate = firstPaymentDate.SelectedDate.Value;

                newLease.MonthlyPayment = decimal.Parse(value);

                if (months12.IsChecked == true)
                {
                    newLease.NumOfPayments = 12;
                }
                if (months24.IsChecked == true)
                {
                    newLease.NumOfPayments = 24;
                }
                if (months36.IsChecked == true)
                {
                    newLease.NumOfPayments = 36;
                }
                if (months48.IsChecked == true)
                {
                    newLease.NumOfPayments = 48;
                }

                this.vehicle       = vehiclesList.SelectedItem as DetailedVehicle;
                newLease.VehicleID = this.vehicle.VIN;

                this.term        = termsList.SelectedItem as LeaseTerm;
                newLease.TermsID = this.term.LeaseTermID;

                this.customer       = customersList.SelectedItem as Customer;
                newLease.CustomerID = this.customer.CustomerID;

                newLease.StatusID = 1;

                var confirmSave = MessageBox.Show("LeaseID: " + newLease.LeaseID + "\n" +
                                                  "Contract Date: " + newLease.ContractDate + "\n" +
                                                  "Vehicle ID: " + newLease.VehicleID + "\n" +
                                                  "Terms ID: " + newLease.TermsID + "\n" +
                                                  "CustomerID: " + newLease.CustomerID + "\n" +
                                                  "First Payment Date: " + newLease.FirstPaymentDate + "\n" +
                                                  "Amount: " + newLease.MonthlyPayment + "\n" +
                                                  "Num of Payments: " + newLease.NumOfPayments + "\n",
                                                  "Save the following new listing?", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (confirmSave == MessageBoxResult.Yes)
                {
                    ObjectSet <LeasesP> leases = multileaseContext.LeasesPs;
                    leases.AddObject(newLease);
                    multileaseContext.SaveChanges();
                    MessageBox.Show("New lease saved successfully!", "New Lease Saved", MessageBoxButton.OK, MessageBoxImage.Information);
                    this.Close();
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error saving new lease", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }