public ActionResult UnverifyAgent(string id) { string decrypted_id = AppHandler.Decrypt(id); new DB().ExecuteQuery("Update Landlords set [Status] = 'Active Unverified' where IDforLand = '" + decrypted_id + "'"); return(RedirectToAction("Index")); }
// GET: Tenants/Edit/5 public ActionResult Edit(string id) { int idDecrypted = int.Parse(AppHandler.Decrypt(id)); //if (id == null) //{ // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //} Tenant tenant = db.Tenants.Find(idDecrypted); if (tenant == null) { return(HttpNotFound()); } //ViewBag.ApplicationUserId = new SelectList(db.Users, "Id", "Email", landlord.ApplicationUserId); TenantViewModel model = new TenantViewModel { TenantID = tenant.TenantID, AccountNo = tenant.AccountNo, LandlordID = tenant.LandlordID, Title = tenant.Title, Surname = tenant.Surname, OtherNames = tenant.OtherNames, Address = tenant.Address, Phone = tenant.Phone, RegDate = tenant.RegDate, PropertyID = tenant.PropertyID, StartDate = tenant.StartDate, EndDate = tenant.EndDate, Status = tenant.Status, NoOfProperty = tenant.NoOfProperty, Rent = tenant.Rent, PropertyNo = tenant.PropertyNo, RentPaymentStatus = tenant.RentPaymentStatus, CycleCount = tenant.CycleCount, EndOfGrace = tenant.EndOfGrace, NoOfPropertyUnits = tenant.NoOfPropertyUnits, ApplicationUserId = tenant.ApplicationUserId }; return(View(model)); }