public bool Validate(InstructorDao i) { if (PrimaryKeyValidate(i.InstructorId) && StringValidate(i.FirstName, 100) && StringValidate(i.LastName, 100) ) { return(true); } return(false); }
public bool DeleteInstructor(InstructorDao instructor) { try { return(ac.DeleteInstructor(emap.MapToData(instructor))); } catch (Exception) { return(false); } }
public bool UpdateInstructor(InstructorDao instructor) { try { if (instructorVal.Validate(instructor)) { return(ac.UpdateInstructor(emap.MapToData(instructor))); } return(false); } catch (Exception) { return(false); } }
public bool InsertInstructor(InstructorDao newinstructor) { try { if (instructorVal.Validate(newinstructor)) { return(ac.InsertInstructor(emap.MapToData(newinstructor)));; } return(false); } catch (Exception) { return(false); } }
/// <summary> /// Validates the data coming in from the data layer /// </summary> public bool ValidateSoapData(InstructorDao instructor) { int maxName = 50; if (val.ValidateInt(instructor.InstructorId) && val.ValidateRequiredString(instructor.FirstName, maxName) && val.ValidateRequiredString(instructor.LastName, maxName)) { return(true); } else { return(false); } }
/// <summary> /// After successful validation, this method will map the data from the Data Layer to the Dto /// </summary> public InstructorDto MapToRest(InstructorDao i) { var mapper = instructorMapper.CreateMapper(); return(mapper.Map <InstructorDto>(i)); }
public Instructor MapToData(InstructorDao instuctor) { var mapper = InstructorMapper.CreateMapper(); return(mapper.Map <Instructor>(instuctor)); }