Good to all I comment the idea here is that to an Id of a File can be assigned to several users
eg IdExpediente: 51
can be assigned to IdMail: 17 y 58
and that is saved in table T_MAIL_EXP
as I can do to be loaded in the table the way it shows
Id Expediente Id_Mail
51 17
51 58
This would be the code:
[HttpPost]
public ActionResult Asignar(FormCollection coleccion)
{
string _exp_id = Request["exp"];
string _username = "";
//int _id_Expediente;
if (this.User.Identity.IsAuthenticated)
_username = this.User.Identity.Name;
try
{
T_EXP_ENVIO dbExpEnvio = new T_EXP_ENVIO()
{
N__Expediente = _exp_id
};
_seguimientoExpServicio.AgregarExpediente(dbExpEnvio);
var IdExpEnvio = _seguimientoExpServicio.ObtenerIdExpEnvio(_exp_id);
var lista = _seguimientoExpServicio.ObtenerIdMailPorUsuario(_username);
T_MAIL_EXP dbMailExp = new T_MAIL_EXP()
{
id_Expediente = IdExpEnvio,
// id_Mails = lista.Sele
};