Пример #1
0
        private void SaveOld()
        {
            using (ItsEntities Context = new ItsEntities())
            {
                Issues DBIssue = Context.Issues.Where(p => p.IssueId == IssueId).FirstOrDefault();
                if (DBIssue == null) return;

                DBIssue.Subject = Subject;
                DBIssue.Description = Description;

                Context.SaveChanges();
            }
        }
Пример #2
0
        public static List<Issue> GetIssues()
        {
            List<Issue> Result = new List<Issue>();

            using (ItsEntities Context = new ItsEntities())
            {
                foreach (var DBIssue in Context.Issues)
                {
                    Result.Add(new Issue().ConvertFromEntity(DBIssue));
                }
            }

            return Result;
        }
Пример #3
0
        private void SaveNew()
        {
            using (ItsEntities Context = new ItsEntities())
            {
                Issues DBIssue = new Issues()
                {
                    Subject = Subject,
                    Description = Description
                };

                Context.Issues.Add(DBIssue);

                Context.SaveChanges();
                IssueId = DBIssue.IssueId;
            }
        }