Ejemplo n.º 1
0
 public void UpdateItem(SubjectItem t)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository <SubjectItem>();
         rep.Update(t);
     }
 }
Ejemplo n.º 2
0
 //insert on subject
 public void CreateSubject(SubjectItem t)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository <SubjectItem>();
         rep.Insert(t);
     }
 }
Ejemplo n.º 3
0
 public void DeleteItem(SubjectItem t)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository<SubjectItem>();
         rep.Delete(t);
     }
 }
Ejemplo n.º 4
0
 //insert on subject
 public void CreateSubject(SubjectItem t)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository<SubjectItem>();
         rep.Insert(t);
     }
 }
Ejemplo n.º 5
0
        public SubjectItem GetSubject(int SubjectId)
        {
            SubjectItem subitem = new SubjectItem();

            using (IDataContext ctx = DataContext.Instance())
            {
                var rec = ctx.ExecuteQuery <SubjectItem>(CommandType.TableDirect, "select * from SubjectItems where subjectid=" + SubjectId);
                foreach (var val in rec)
                {
                    subitem.Subject = val.Subject; subitem.Mother = val.Mother; subitem.Order = val.Order;
                }
            }

            return(subitem);
        }
Ejemplo n.º 6
0
        public SubjectItem GetSubject(int SubjectId)
        {
            SubjectItem subitem = new SubjectItem();
            using (IDataContext ctx = DataContext.Instance())
            {
                var rec = ctx.ExecuteQuery<SubjectItem>(CommandType.TableDirect, "select * from SubjectItems where subjectid="+SubjectId);
                foreach (var val in rec)
                {
                   subitem.Subject = val.Subject; subitem.Mother = val.Mother; subitem.Order = val.Order ;
                }
            }

            return subitem;
        }