Exemplo n.º 1
0
        public static int Save(StudentReportInformation studentReportInfo)
        {
            var a = new StudentReportInformation
            {
                StudentReportInformationsId         = studentReportInfo.StudentReportInformationsId,
                StudentReportInformationReportsName = studentReportInfo.StudentReportInformationReportsName,
                StudentReportInformationDescription = studentReportInfo.StudentReportInformationDescription,
                StudentReportInformationCode        = studentReportInfo.StudentReportInformationCode,
                ModifiedOn         = studentReportInfo.ModifiedOn,
                CurriculumDetailId = studentReportInfo.CurriculumDetailId,
                CurriculumDetail   = studentReportInfo.CurriculumDetail
            };

            using (_d = new DataRepository <StudentReportInformation>())
            {
                if (studentReportInfo.StudentReportInformationsId > 0)
                {
                    _d.Update(a);
                }
                else
                {
                    _d.Add(a);
                }
                _d.SaveChanges();
            }
            return(a.StudentReportInformationsId);
        }
Exemplo n.º 2
0
 public static bool Delete(StudentReportInformation studentReportInfo)
 {
     using (_d = new DataRepository <StudentReportInformation>())
     {
         _d.Delete(studentReportInfo);
         _d.SaveChanges();
     }
     return(true);
 }