public static bool AddIssue(Issue issue) { try { using (var db = new IssuesEntities()) { db.Issue.Add(issue); db.SaveChanges(); return true; } } catch (Exception e) { Console.WriteLine(e.Message); return false; } }
public bool AddIssue(IssueAjax item) { try { var issue = new Issue { CreatedOn = DateTime.Now, ModifiedOn = null, Status = item.StatusId, Type = item.TypeId, Title = item.Title, Description = item.Description }; return DbMethods.AddIssue(issue); } catch (Exception e) { Console.WriteLine(e.Message); throw; } }