Henriquee
Henriquee
CC#
Created by Henriquee on 6/25/2023 in #help
❔ Mapping error
fixed
8 replies
CC#
Created by Henriquee on 6/25/2023 in #help
❔ Mapping error
Vehicle class:
using Ambipar.Response.PortalServices.Shared.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Ambipar.Response.Modules.Vehicles.Core.Entities
{
public class Vehicle : BaseEntity<Vehicle>
{

public bool Active { get; set; }

public bool Maintenance { get; set; }

public bool Tracked { get; set; }

public string HasTrackingSystem { get; set; }

public string TrackingSystemName { get; set; }

public string Renavam { get; set; }
public string LicensePlate { get; set; }

public int? ManufacturingYear { get; set; }

public int? ModelYear { get; set; }


public Guid BusinessUnityId { get; set; }


public Guid WorkBaseId { get; set; }

public string Type { get; set; }


public Guid VehicleCategoryId { get; set; }
public VehicleCategory VehicleCategory { get; set; }

public Guid VehicleFuelTypeId { get; set; }

public VehicleFuelType VehicleFuelType { get; set; }

public Guid VehicleGroupId { get; set; }

public VehicleGroup VehicleGroup { get; set; }

public Guid VehicleOperationId { get; set; }

public VehicleOperation VehicleOperation { get; set; }
public Guid VehicleModelId { get; set; }
public VehicleModel VehicleModel { get; set; }

public Guid VehicleBrandId { get; set; }
public VehicleBrand VehicleBrand { get; set; }

public Guid VehicleGroupCompanyId { get; set; }

public VehicleGroupCompany VehicleGroupCompany { get; set; }


public string FleetNumber { get; set; }

public string Chassis { get; set; }

public string HasSupplyTank { get; set; }

public string SupplyTankCapacity { get; set; }



}
}
using Ambipar.Response.PortalServices.Shared.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Ambipar.Response.Modules.Vehicles.Core.Entities
{
public class Vehicle : BaseEntity<Vehicle>
{

public bool Active { get; set; }

public bool Maintenance { get; set; }

public bool Tracked { get; set; }

public string HasTrackingSystem { get; set; }

public string TrackingSystemName { get; set; }

public string Renavam { get; set; }
public string LicensePlate { get; set; }

public int? ManufacturingYear { get; set; }

public int? ModelYear { get; set; }


public Guid BusinessUnityId { get; set; }


public Guid WorkBaseId { get; set; }

public string Type { get; set; }


public Guid VehicleCategoryId { get; set; }
public VehicleCategory VehicleCategory { get; set; }

public Guid VehicleFuelTypeId { get; set; }

public VehicleFuelType VehicleFuelType { get; set; }

public Guid VehicleGroupId { get; set; }

public VehicleGroup VehicleGroup { get; set; }

public Guid VehicleOperationId { get; set; }

public VehicleOperation VehicleOperation { get; set; }
public Guid VehicleModelId { get; set; }
public VehicleModel VehicleModel { get; set; }

public Guid VehicleBrandId { get; set; }
public VehicleBrand VehicleBrand { get; set; }

public Guid VehicleGroupCompanyId { get; set; }

public VehicleGroupCompany VehicleGroupCompany { get; set; }


public string FleetNumber { get; set; }

public string Chassis { get; set; }

public string HasSupplyTank { get; set; }

public string SupplyTankCapacity { get; set; }



}
}
8 replies
CC#
Created by Henriquee on 6/25/2023 in #help
❔ Mapping error
UpdateVehicleDto class:
using Ambipar.Response.Modules.Vehicles.Core.Entities;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Security.Principal;

namespace Ambipar.Response.Modules.Vehicles.Shared.Dtos;

public class UpdateVehicleDto
{

public Guid Id { get; set; }
public bool Active { get; set; }

public bool Maintenance { get; set; }

public bool Tracked { get; set; }

public string HasTrackingSystem { get; set; }

public string TrackingSystemName { get; set; }

public string Renavam { get; set; }


public string LicensePlate { get; set; }

public Guid VehicleCategoryId { get; set; }

public Guid VehicleFuelTypeId { get; set; }

public Guid VehicleGroupId { get; set; }

public Guid VehicleBrandId { get; set; }

public Guid VehicleModelId { get; set; }

public Guid VehicleOperationId { get; set; }

public VehicleOperation VehicleOperation { get; set; }

public Guid WorkBaseId { get; set; }

public int? ManufacturingYear { get; set; }

public int? ModelYear { get; set; }

public Guid BusinessUnityId { get; set; } = new Guid("e39ac9b5-652b-4838-a432-924cbfa1e9fb");


public SelectList GroupCompany { get; set; }

public Guid VehicleGroupCompanyId { get; set; }

public SelectList VehicleGroupCompany { get; set; }

public SelectList BusinessUnity { get; set; }

public SelectList Category { get; set; }


public string Type { get; set; }


public SelectList FuelType { get; set; }


public SelectList Group { get; set; }
public SelectList Operation { get; set; }

public SelectList Brand { get; set; }

public SelectList Model { get; set; }

public string FleetNumber { get; set; }

public string Chassis { get; set; }

public string HasSupplyTank { get; set; }

public string SupplyTankCapacity { get; set; }


}
using Ambipar.Response.Modules.Vehicles.Core.Entities;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Security.Principal;

namespace Ambipar.Response.Modules.Vehicles.Shared.Dtos;

public class UpdateVehicleDto
{

public Guid Id { get; set; }
public bool Active { get; set; }

public bool Maintenance { get; set; }

public bool Tracked { get; set; }

public string HasTrackingSystem { get; set; }

public string TrackingSystemName { get; set; }

public string Renavam { get; set; }


public string LicensePlate { get; set; }

public Guid VehicleCategoryId { get; set; }

public Guid VehicleFuelTypeId { get; set; }

public Guid VehicleGroupId { get; set; }

public Guid VehicleBrandId { get; set; }

public Guid VehicleModelId { get; set; }

public Guid VehicleOperationId { get; set; }

public VehicleOperation VehicleOperation { get; set; }

public Guid WorkBaseId { get; set; }

public int? ManufacturingYear { get; set; }

public int? ModelYear { get; set; }

public Guid BusinessUnityId { get; set; } = new Guid("e39ac9b5-652b-4838-a432-924cbfa1e9fb");


public SelectList GroupCompany { get; set; }

public Guid VehicleGroupCompanyId { get; set; }

public SelectList VehicleGroupCompany { get; set; }

public SelectList BusinessUnity { get; set; }

public SelectList Category { get; set; }


public string Type { get; set; }


public SelectList FuelType { get; set; }


public SelectList Group { get; set; }
public SelectList Operation { get; set; }

public SelectList Brand { get; set; }

public SelectList Model { get; set; }

public string FleetNumber { get; set; }

public string Chassis { get; set; }

public string HasSupplyTank { get; set; }

public string SupplyTankCapacity { get; set; }


}
8 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
thank you so much
20 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
it worked now!
20 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
damn was the [httget]
20 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
so i should change for <button> ?
20 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
[HttpPost]
20 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
public async Task<IActionResult> QualificationEpaeDelete(int id, OpportunityQualificationEpaeViewModel model) { var result = await _opportunityQualificationEpaeService.DeleteAsync(id); FlashMessage.Success("CNPJ excluido com sucesso!"); return RedirectToAction(nameof(OpportunityQualificationEpae), new { opportunityId = model.OpportunityId }); }
20 replies
CC#
Created by Henriquee on 5/21/2023 in #help
❔ Razor MVC
I believe so, I have a first form that serves to save the information from my inputs: <form id="formQualification" asp-action="QualificationEpaeSave" class="col-12 d-flex flex-column justify-content-start"> So, if there is already an item in the db with the same ID, I search and retrieve them through the Model, so I made a foreach to render them, and it's basically a crud, I made a delete function and I'm trying to apply it to my delete button, the only way I could make it work was by putting another form inside that foreach and doing the asp-action for my delete function, but due to having a form inside another form, there were some bugs, and then I found out that it is also a bad practice, so I would like to know if there is any way to put the function in my controller directly on my button
20 replies