Ejemplo n.º 1
0
 /// <summary>
 /// load property details from database
 /// </summary>
 private void LoadPropertyDetails()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         int id = Convert.ToInt32(Request.QueryString["Id"]);
         var propertyBusiness = new PropertyBusiness();
         var result           = propertyBusiness.GetPropertyById(id);
         if (result.Success && result.Model != null)
         {
             TenantPropertyModel model = result.Model;
             lblPropertyName.Text    = model.PropertyName;
             lblAddress.Text         = model.Address;
             lblCity.Text            = model.City;
             lblState.Text           = model.State;
             lblOwnerName.Text       = model.OwnerName;
             lblZip.Text             = model.Zip;
             txttenantFirstName.Text = model.Firstname;
             txttenantLastName.Text  = model.Lastname;
             txtRentAmount.Text      = model.Amount.ToString();
             txtStartDate.Text       = model.StartDate.ToString();
             txtEndDate.Text         = model.EndDate.ToString();
         }
     }
     else
     {
         litMsg.Text = "Invalid property Id";
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// method to get the property details
 /// </summary>
 private void LoadPropertyDetails()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         int id = Convert.ToInt32(Request.QueryString["Id"]);
         var propertyBusiness = new PropertyBusiness();
         var result           = propertyBusiness.GetPropertyById(id);
         if (result.Success && result.Model != null)
         {
             TenantPropertyModel model = result.Model;
             lblPropertyName.Text    = model.PropertyName;
             lblAddress.Text         = model.Address;
             lblCity.Text            = model.City;
             lblState.Text           = model.State;
             lblOwnerName.Text       = model.OwnerName;
             lblZip.Text             = model.Zip;
             txttenantFirstName.Text = model.Firstname;
             txttenantLastName.Text  = model.Lastname;
             txtRentAmount.Text      = model.Amount.ToString();
             txtStartDate.Text       = model.StartDate.ToShortDateString();
             txtEndDate.Text         = model.EndDate.ToShortDateString();
             hdnTenantId.Value       = model.TenantID.ToString();
             if (model.TenantID > 0)
             {
                 btnAdd.Text = "Update Tenant";
             }
             if (model.FileName != null)
             {
                 documentName = model.FileName;
                 documentURL  = "documents/" + documentName;
                 btnGoogleDrive.CommandArgument = documentName;
                 hdnFileName.Value = documentName;
             }
         }
         else
         {
             litMsg.Text    = "Invalid property Id";
             btnAdd.Enabled = false;
         }
     }
 }