public IActionResult Create(GuarantorCreateViewModel model) { if (ModelState.IsValid) { //int maxi = _guarantorRepo.GetGuarantors().Max(e => e.id) + 1; //string uniqueFileName = ProcessPhoto(model); Guarantor Newguarantor = new Guarantor { //id = maxi, EmployeeId = model.studentId, Name = model.Name, Email = model.Email, HomePhone = model.HomePhone, //Photo = uniqueFileName, OfficePhone = model.OfficePhone, CompanyName = model.CompanyName, Position = model.Position, Address = model.Address, }; _guarantorRepo.AddGuarantor(Newguarantor); return(RedirectToAction("index", "home")); } return(View()); }
public ViewResult Create(int id) { GuarantorCreateViewModel gcv = new GuarantorCreateViewModel() { studentId = id, Name = "defaultName", Email = "defaultEmail", Address = "defaultAddress", CompanyName = "defaultCname", HomePhone = "defaultHome", OfficePhone = "defaultOff", Position = "defaultPos" }; return(View(gcv)); }