Hi there, I have created Entity models. I would like to design a xaml in wfp to insert and update records like spreadsheet. i have attached sample entities and screenshot. Here Column represents : Subject and total Marks Rows represents : class Section and students Cell is to update marks objects in that particular subject by students
How can I add Subject(column) at run time and save it to database?
How can I Standard, ClassSection and student and their mark (Rows) in grid and save it to database?
Can anyone suggest the approach?
- Below are the Models:
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Data.Entity;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace School.Model
- {
- public class SchoolContext : DbContext
- {
- public DbSet
Standards { get; set; } - public DbSet
Subjects { get; set; } - public DbSet
ClassSections { get; set; } - public DbSet
Students { get; set; } - public DbSet
Results { get; set; } - }
- public class Standard
- {
- [Key]
- public int Id { get; set; }
- public string Name { get; set; }
- public ICollection
Subjects { get; set; } - public ICollection
ClassSections { get; set; } - }
- public class Subject
- {
- [Key]
- public int Id { get; set; }
- public string Name { get; set; }
- public int TotalMarks { get; set; }
- public int? StandardId { get; set; }
- public virtual Standard Standard { get; set; }
- public ICollection
Results { get; set; } - }
- public class ClassSection
- {
- [Key]
- public int Id { get; set; }
- public string Name { get; set; }
- public int? StandardId { get; set; }
- public virtual Standard Standard { get; set; }
- public ICollection
Students { get; set; } - }
- public class Student
- {
- [Key]
- public int Id { get; set; }
- public string Name { get; set; }
- public int? ClassSectionId { get; set; }
- public virtual ClassSection ClassSection { get; set; }
- public ICollection
Results { get; set; } - }
- public class Result
- {
- [Key]
- public int Id { get; set; }
- public int SubjectId { get; set; }
- public int StudentId { get; set; }
- public int ObtainedMarks { get; set; }
- public virtual Subject Subject { get; set; }
- public virtual Student Student { get; set; }
- }
- }

Piyush PansuriyaPosted Jan 26, 2017, 11:48 PM
dhiraj sakariyaPosted Jan 25, 2017, 10:59 PM
Piyush PansuriyaPosted Jan 25, 2017, 6:15 AM