예제 #1
0
        public Cyber Edit(Cyber entity, CyberModel model)
        {
            entity.CyberId = model.CyberId;


            entity.CourseId      = model.CourseId;
            entity.StateId       = model.StateId;
            entity.HigherId      = model.HigherId;
            entity.FirstName     = model.FirstName;
            entity.LastName      = model.LastName;
            entity.OtherNames    = model.OtherNames;
            entity.Email         = model.Email;
            entity.Contact       = model.Contact;
            entity.ClassOfDigree = model.ClassOfDigree;

            entity.DateOfBirth = model.DateOfBirth;
            entity.Email       = model.Email;
            entity.Gender      = model.Gender;

            entity.Address = model.Address;

            entity.ModifiedDate = DateTime.Now;
            entity.ModifiedBy   = model.ModifiedBy;

            return(entity);
        }
예제 #2
0
        public Cyber Create(CyberModel model)
        {
            int      age         = 0;
            DateTime currentDate = DateTime.Now;
            DateTime dob         = Convert.ToDateTime(model.DateOfBirth);

            age       = (currentDate.Year) - (dob.Year);
            model.Age = age;


            return(new Cyber
            {
                //UserId = model.UserId,
                HigherId = model.HigherId,
                CourseId = model.CourseId,
                StateId = model.StateId,
                ContentType = model.ContentType,
                FirstName = model.FirstName,
                LastName = model.LastName,
                OtherNames = model.OtherNames,
                Address = model.Address,
                ClassOfDigree = model.ClassOfDigree,
                Contact = model.Contact,
                Qualification = model.Qualification,
                Grade = model.Grade,
                DateOfBirth = model.DateOfBirth,
                Email = model.Email,
                Gender = model.Gender,
                NYSC_upload = model.NYSC_upload,
                Age = model.Age,
                //SchoolAttended = model.SchoolAttended,
                //State = model.State,
                YearOfGraduation = model.YearOfGraduation,
                CreatedDate = DateTime.Now,
                CreatedBy = model.CreatedBy,
                NYSCFileName = model.NYSCFileName
            });
        }