Exemplo n.º 1
0
        public bool UpdateEnrollee(EnrolleePassport enroleepassport)
        {
            if (enroleepassport != null)
            {
                _session.Transact(session => session.Update(enroleepassport));

                _helpersvc.Log(LogEntryType.Audit, null,
                               string.Format(
                                   "EnrolleePassport has been updated on the  system enrollee id {0}, by {1}",
                                   enroleepassport.Id, CurrentRequestData.CurrentUser.Id.ToString()), "Enrollee Updated.");
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public bool AddEnrollee(Enrollee enrollee, byte[] imgData)
        {
            bool exist =
                _session.QueryOver <Enrollee>()
                .Where(
                    x =>
                    x.Policynumber == enrollee.Policynumber.ToLower() ||
                    x.Policynumber == enrollee.Policynumber.ToUpper()).Any();



            if (enrollee != null && !exist)
            {
                EnrolleePassport imagerec = new EnrolleePassport();
                imagerec.Enrolleeid       = enrollee.Id;
                imagerec.Enrolleepolicyno = enrollee.Policynumber;
                imagerec.Imgraw           = imgData;

                enrollee.EnrolleePassport = imagerec;

                _session.Transact(session => session.Save(enrollee));



                if (enrollee.Parentid > 0)
                {
                }
                else
                {
                    //update the staff to indicate update
                    Staff staff = _session.QueryOver <Staff>().Where(x => x.Id == enrollee.Staffprofileid).SingleOrDefault();

                    staff.HasProfile = true;
                    staff.Profileid  = enrollee.Id;
                    _session.Transact(session => session.Save(staff));
                }


                int curr = CurrentRequestData.CurrentUser != null ? CurrentRequestData.CurrentUser.Id : 0;


                _helpersvc.Log(LogEntryType.Audit, null,
                               string.Format(
                                   "New enrollee has been added to the system enrollee name {0} , enrollee id {1}, by {2}",
                                   enrollee.Surname + " " + enrollee.Othernames, enrollee.Id, curr), "Enrollee Added.");

                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        public EnrolleePassport GetEnrolleepassport(int enrolleeid)
        {
            EnrolleePassport enrolleePass = _session.QueryOver <EnrolleePassport>().Where(x => x.Enrolleeid == Convert.ToInt32(enrolleeid)).SingleOrDefault();

            return(enrolleePass);
        }