public ActionResult AirportIdentifierEdit( System.Guid airportIdentifierId ) { ViewBag.AirportIdentifierId = airportIdentifierId; var airportIdentifierContract = new AirportIdentifierContract(); airportIdentifierContract.AirportIdentifier = new CrudeAirportIdentifierServiceClient().FetchByAirportIdentifierId(airportIdentifierId); ViewBag.AirportId = new SelectList(new CrudeAirportServiceClient().FetchAll(), "AirportId", "AirportName", airportIdentifierContract.AirportIdentifier.AirportId ); ViewBag.AirportIdentifierTypeRcd = new SelectList(new CrudeAirportIdentifierTypeRefServiceClient().FetchAll(), "AirportIdentifierTypeRcd", "AirportIdentifierTypeName", airportIdentifierContract.AirportIdentifier.AirportIdentifierTypeRcd ); ViewBag.DefaultUserName = new CrudeDefaultUserServiceClient().FetchByDefaultUserId(airportIdentifierContract.AirportIdentifier.UserId).DefaultUserName; return(View( "~/Views/Templates/Airport/AirportIdentifier/AirportIdentifierEdit.cshtml", airportIdentifierContract )); }
public ActionResult AirportIdentifierCreate([Bind()] AirportIdentifierContract airportIdentifierContract, System.Guid airportId, System.String airportIdentifierTypeRcd) { if (ModelState.IsValid) { airportIdentifierContract.AirportIdentifier.AirportId = airportId; airportIdentifierContract.AirportIdentifier.AirportIdentifierTypeRcd = airportIdentifierTypeRcd; new CrudeAirportIdentifierServiceClient().Insert(airportIdentifierContract.AirportIdentifier); return(RedirectToAction("AirportIdentifierIndex", new { airportId = airportIdentifierContract.AirportIdentifier.AirportId })); } return(View( "~/Views/Templates/Airport/AirportIdentifier/AirportIdentifierCreate.cshtml", airportIdentifierContract )); }
public ActionResult AirportIdentifierCreate(System.Guid?airportId, System.Guid?userId) { var airportIdentifierContract = new AirportIdentifierContract(); airportIdentifierContract.AirportIdentifier = new CrudeAirportIdentifierContract(); if (airportId != null) { airportIdentifierContract.AirportIdentifier.AirportId = (System.Guid)airportId; } if (userId != null) { airportIdentifierContract.AirportIdentifier.UserId = (System.Guid)userId; } ViewBag.AirportId = new SelectList(new CrudeAirportServiceClient().FetchAll(), "AirportId", "AirportName", airportIdentifierContract.AirportIdentifier.AirportId ); ViewBag.AirportIdentifierTypeRcd = new SelectList(new CrudeAirportIdentifierTypeRefServiceClient().FetchAll(), "AirportIdentifierTypeRcd", "AirportIdentifierTypeName", airportIdentifierContract.AirportIdentifier.AirportIdentifierTypeRcd ); if (userId == null) { airportIdentifierContract.AirportIdentifier.UserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}"); } ViewBag.DefaultUserName = new CrudeDefaultUserServiceClient().FetchByDefaultUserId(airportIdentifierContract.AirportIdentifier.UserId).DefaultUserName; airportIdentifierContract.AirportIdentifier.DateTime = DateTime.UtcNow; return(View( "~/Views/Templates/Airport/AirportIdentifier/AirportIdentifierCreate.cshtml", airportIdentifierContract )); }