internal InternshipScholarshipsDetailsBLL MapInternshipScholarshipDetail(InternshipScholarshipsDetails InternshipScholarshipDetail) { try { InternshipScholarshipsDetailsBLL InternshipScholarshipDetailBLL = null; if (InternshipScholarshipDetail != null) { InternshipScholarshipDetailBLL = new InternshipScholarshipsDetailsBLL() { InternshipScholarshipDetailID = InternshipScholarshipDetail.InternshipScholarshipDetailID, InternshipScholarship = new BaseInternshipScholarshipsBLL().MapInternshipScholarship(InternshipScholarshipDetail.InternshipScholarships), EmployeeCareerHistory = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(InternshipScholarshipDetail.EmployeesCareersHistory), IsPassengerOrderCompensation = InternshipScholarshipDetail.IsPassengerOrderCompensation }; } return(InternshipScholarshipDetailBLL); } catch { throw; } }
public Result Add(InternshipScholarshipsDetailsBLL InternshipScholarshipDetailBLL) { Result result = new Result(); // validate employee already exists InternshipScholarshipsDetails employee = new InternshipScholarshipsDetailsDAL().GetInternshipScholarshipsDetailsByInternshipScholarshipID(InternshipScholarshipDetailBLL.InternshipScholarship.InternshipScholarshipID) .Where(d => d.EmployeeCareerHistoryID == InternshipScholarshipDetailBLL.EmployeeCareerHistory.EmployeeCareerHistoryID).FirstOrDefault(); if (employee != null) { result.Entity = null; result.EnumType = typeof(InternshipScholarshipsValidationEnum); result.EnumMember = InternshipScholarshipsValidationEnum.RejectedBecauseAlreadyExist.ToString(); return(result); } result = new Result(); InternshipScholarshipsDetails InternshipScholarshipDetail = new InternshipScholarshipsDetails() { InternshipScholarshipID = InternshipScholarshipDetailBLL.InternshipScholarship.InternshipScholarshipID, EmployeeCareerHistoryID = InternshipScholarshipDetailBLL.EmployeeCareerHistory.EmployeeCareerHistoryID, CreatedDate = DateTime.Now, CreatedBy = InternshipScholarshipDetailBLL.LoginIdentity.EmployeeCodeID, IsPassengerOrderCompensation = InternshipScholarshipDetailBLL.IsPassengerOrderCompensation }; this.InternshipScholarshipDetailID = new InternshipScholarshipsDetailsDAL().Insert(InternshipScholarshipDetail); if (this.InternshipScholarshipDetailID != 0) { result.Entity = null; result.EnumType = typeof(InternshipScholarshipsValidationEnum); result.EnumMember = InternshipScholarshipsValidationEnum.Done.ToString(); } return(result); }