Ejemplo n.º 1
0
        public void AddRenterToArea(AreaRect area, RenterRect renter)
        {
            var ar   = context.Value.RentAreas.Where(a => a.Id == area.Id).Select(c => c).FirstOrDefault();
            var rent = context.Value.Renters.Where(r => r.Id == renter.Id).Select(c => c).FirstOrDefault();

            ar.Renter = rent;
            context.Value.SaveChanges();
        }
Ejemplo n.º 2
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     rrNew = new RenterRect()
     {
         RenterName    = tbRenterName.Text, Contract = tbContract.Text,
         StartDate     = dtpStart.Value, EndDate = dtpEnd.Value,
         ContactPerson = tbContacts.Text, ContactPhone = tbPhones.Text,
         Annotation    = tbAnnotation.Text
     };
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 3
0
        public void UpdateRenter(RenterRect oldR, RenterRect newR)
        {
            var rU = context.Value.Renters.Where(r => r.Id == oldR.Id).FirstOrDefault();

            rU.RenterName    = newR.RenterName;
            rU.Contract      = newR.Contract;
            rU.StartDate     = newR.StartDate;
            rU.EndDate       = newR.EndDate;
            rU.ContactPerson = newR.ContactPerson;
            rU.ContactPhone  = newR.ContactPhone;
            rU.Annotation    = newR.Annotation;
            context.Value.SaveChanges();
        }
Ejemplo n.º 4
0
 public void AddRenter(RenterRect renter)
 {
     context.Value.Renters.Add(new Renter()
     {
         RenterName    = renter.RenterName,
         Contract      = renter.Contract,
         StartDate     = renter.StartDate,
         EndDate       = renter.EndDate,
         ContactPerson = renter.ContactPerson,
         ContactPhone  = renter.ContactPhone,
         Annotation    = renter.Annotation
     });
     context.Value.SaveChanges();
 }
Ejemplo n.º 5
0
 private void RenterList_FormClosed(object sender, FormClosedEventArgs e)
 {
     renterOut = dgRenters.CurrentRow.DataBoundItem as RenterRect;
 }