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); }
public static bool Delete(StudentReportInformation studentReportInfo) { using (_d = new DataRepository <StudentReportInformation>()) { _d.Delete(studentReportInfo); _d.SaveChanges(); } return(true); }