/* Obtiene los casos de un Usuario */ /* Agrega un Caso */ public bool Post(M.Case caso) { O.Case BDCaso = new O.Case { Name = caso.Name, DescriptionCase = caso.DescriptionCase, PostedDate = System.DateTime.Now.ToString("g"), PostedHourZone = System.TimeZoneInfo.Local.ToString(), IdUser = caso.IdUser }; BD.Cases.Add(BDCaso); BD.SaveChanges(); return(true); }
public bool Post(long idCase) { bool result = false; try { O.Case caso = BD.Cases.FirstOrDefault(x => x.Id == idCase); BD.Cases.Remove(caso); BD.SaveChanges(); result = true; } catch { result = false; } return(result); }