Good morning / afternoon / night SOes,
It's been several days since I've been trying to make a statement and I can not hit the key.
The topic is the following :
I have to add to a Contract depending on which one, a letter in front: "A" or "B", I am using MVC. I have my method in the controller which receives as a parameter a Type, ID, year and month.
[HttpGet]
public JsonResult Cto(string Tipo, int IdProveedor, int Anio, int Mes)
{
switch (Tipo) {
case "A":
return new JsonResult() { Data = servicio.GetContratoA(Id, Anio, Mes).ToList(), JsonRequestBehavior = JsonRequestBehavior.AllowGet };
case "B":
return new JsonResult() { Data = servicio.GetContratoB(Id, Anio, Mes).ToList(), JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
}
Now, this JSon method is called by my Vista Index with an AJAX function.
function LoadCto(tipo) {
The data brings me perfectly, the question is: How do I add the letter I want (either A or B) ahead of these contracts?
OUTPUT OBTAINED:
CONTRATO 1
DESIRED DEPARTURE (type A check)
A CONTRATO 1
DESIRED DEPARTURE (type B)
B CONTRATO 5
TIP: I can not add it in the GetContract function called service because it causes me an Entity problem since this method is used in several instances.