Пример #1
0
        public static void OnSaving(IVisa visa, IObjectSpace obspace)
        {
            //Visa Type


            // VisaIssuedPlace
        }
Пример #2
0
        public static void AfterChange_VisaIssuedDate(IVisa visa)


        {
            if (visa.VisaIssuedDate != null && visa.Passport != null)

            {
                visa.ProcessNumber = Helper.Get_PersonInAppForVisa(visa.Passport.Person, visa);
            }
        }
Пример #3
0
        public static void AfterConstruction(IVisa visa, IObjectSpace obspace)

        {
            var appConf = obspace.FindObject <AppConf>(new BinaryOperator("ID", 1));

            if (appConf != null)
            {
                visa.AppConf = obspace.FindObject <AppConf>(new BinaryOperator("ID", 1));
            }
        }
Пример #4
0
 public GrafikHändelser(IGrafikkommandon grafikkommandon, IBild tileset, IBuffertväxlare buffertväxlare, IVisa visaSpelvärld, Kamera kamera, IVisa visaStatus, ISkärm skärm)
 {
     _gl             = grafikkommandon;
     _tileset        = tileset;
     _buffertväxlare = buffertväxlare;
     _visaSpelvärld  = visaSpelvärld;
     _visaStatus     = visaStatus;
     _kamera         = kamera;
     _scaleFactor    = 4.0;
     _skärm          = skärm;
 }
Пример #5
0
        public static IVisa Get_IssuedVisa(IPersonInResult person)
        {
            IVisa issuedVisa = null;

            foreach (var p in person.AppliedCivil.Passports)
            {
                foreach (var v in p.Visas)
                {
                    if (v.ASNumber == person.Invitation.ASBelgisi)
                    {
                        issuedVisa = v;
                        break;
                    }
                }
            }
            return(issuedVisa);
        }
Пример #6
0
        public static IVisa Get_NewVisa(IPersonInApplication personInApp)

        {
            IVisa visa = null;

            if (personInApp != null)
            {
                foreach (var visaInPassport in personInApp.Passport.Visas)
                {
                    if (visaInPassport.ProcessNumber == personInApp)
                    {
                        visa = visaInPassport;

                        break;
                    }
                }
                return(visa);
            }
            else
            {
                return(null);
            }
        }
Пример #7
0
        public static string Get_Message(IVisa visa)

        {
            return("");
        }
Пример #8
0
 public int Get_RemainingDays(IVisa visa)
 {
     return(Helper.GetRemainingDaysBeforeExpire(visa.VisaEndDate));
 }
Пример #9
0
        public static VisaState Get_VisaState(IVisa visa)

        {
            try
            {
                if (visa.PersonInApplications.Count == 0 && visa.RemainingDays <= 0)
                {
                    return(VisaState.VISA_EXPIRED);
                }

                if (visa.PersonInApplications.Count == 0 && visa.RemainingDays >= 1)
                {
                    return(VisaState.VISA_VALID);
                }

                if (visa.PersonInApplications != null && visa.PersonInApplications.Count == 1)
                {
                    IPersonInApplication personInApp = visa.PersonInApplications.First();
                    if (
                        personInApp.Application.SubType == SubType.ApplicationForCancellingVisa
                        | personInApp.Application.SubType == SubType.ApplicationForCancellingVisaAndWorkpermit

                        | personInApp.Application.SubType == SubType.ApplicationForVisaExtention)
                    {
                        return(VisaStateHelper.GetVisaState(personInApp, visa, VisaState.VISA_NONE));
                    }

                    if (visa.RemainingDays <= 0)
                    {
                        return(VisaState.VISA_EXPIRED);
                    }

                    if (visa.RemainingDays >= 1)
                    {
                        return(VisaState.VISA_VALID);
                    }

                    return(VisaState.VISA_NONE);
                }

                if (visa.PersonInApplications.Count > 1)
                {
                    // IPersonInApplication personInApp = visa.PersonInApplications.OrderByDescending(t => t.Application.ManualApplicationDate).First();
                    IList <IPersonInApplication> personInApp = visa.PersonInApplications.Where(c => !c.Cancelled && !c.Application.Cancelled).Where(t => t.Application.SubType == SubType.ApplicationForVisaExtention
                                                                                                                                                    | t.Application.SubType == SubType.ApplicationForCancellingVisa
                                                                                                                                                    | t.Application.SubType == SubType.ApplicationForCancellingVisaAndWorkpermit
                                                                                                                                                    | t.Application.SubType == SubType.VisaExtentionAccordingToWorkPermit
                                                                                                                                                    ).OrderByDescending(t => t.Application.ManualApplicationDate).ToList();

                    if (personInApp.Count > 0)
                    {
                        IPersonInApplication pInApp = personInApp.First();
                        return(VisaStateHelper.GetVisaState(pInApp, visa, VisaState.VISA_NONE));
                    }

                    if (visa.RemainingDays <= 0)
                    {
                        return(VisaState.VISA_EXPIRED);
                    }

                    if (visa.RemainingDays >= 1)
                    {
                        return(VisaState.VISA_VALID);
                    }
                }

                if (visa.RemainingDays <= 0)
                {
                    return(VisaState.VISA_EXPIRED);
                }

                if (visa.RemainingDays >= 1)
                {
                    return(VisaState.VISA_VALID);
                }


                return(VisaState.VISA_NONE);
            }
            catch (Exception)
            {
                return(VisaState.VISA_NONE);
            }
        }
Пример #10
0
        public static IPersonInApplication Get_PersonInApplication(IVisa visa)



        {
            if (visa.Passport != null && visa.Passport.Person != null && visa.Passport.Person.IsEmployee && visa.Passport.Person.EmployeeInApplications.Count > 0)
            {
                IPersonInApplication appForVisa = null;

                foreach (var personInApp in visa.Passport.Person.EmployeeInApplications)
                {
                    SubType st = personInApp.ApplicationType;


                    switch (st)
                    {
                    case  SubType.ApplicationForVisaExtention:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;

                    case SubType.ApplicationForChangingPassport:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;

                    case SubType.ApplicationForChangingVisaCategory:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;

                    case SubType.ApplicationForCancellingVisaAndWorkpermit:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;
                    }
                }

                return(appForVisa);
            }


            else if (visa.Passport != null && visa.Passport.Person != null && visa.Passport.Person.IsFamilyMember && visa.Passport.Person.FamilyMemberInApplications.Count > 0)
            {
                IPersonInApplication appForVisa = null;

                foreach (var personInApp in visa.Passport.Person.FamilyMemberInApplications)
                {
                    SubType st = personInApp.ApplicationType;


                    switch (st)
                    {
                    case SubType.ApplicationForVisaExtention:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;

                    case SubType.ApplicationForChangingPassport:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;

                    case SubType.ApplicationForChangingVisaCategory:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;

                    case SubType.ApplicationForCancellingVisaAndWorkpermit:

                        if (personInApp.Visa == visa)
                        {
                            appForVisa = personInApp;
                        }
                        break;
                    }
                }

                return(appForVisa);
            }

            else
            {
                return(null);
            }
        }
Пример #11
0
        public static bool Get_ApplicationLicenced(IVisa visa)


        {
            return(true);
        }
Пример #12
0
 public static IList <DevExpress.Persistent.BaseImpl.AuditDataItemPersistent> Get_ChangeHistory(IVisa visa, IObjectSpace os)
 {
     return(DevExpress.Persistent.BaseImpl.AuditedObjectWeakReference.GetAuditTrail(((XPObjectSpace)os).Session, visa));
 }
Пример #13
0
        public static VisaState GetVisaState(IPersonInApplication personInApp, IVisa visa, VisaState unknown)
        {
            //REJECTED
            if (personInApp.Rejected | personInApp.Application.Rejected | personInApp.Application.ApplicationState == ApplicationStateEnum.Rejected)
            {
                return(VisaState.VISA_EXT_REJECTED);
            }

            if (personInApp.Cancelled)
            {
                return(VisaState.VISA_VALID);
            }

            //EXTENTION ON OFFICE
            if (personInApp.Application.SubType == SubType.ApplicationForVisaExtention &&
                personInApp.Application.ApplicationState == ApplicationStateEnum.Office &&
                !personInApp.IsComplete &&
                !personInApp.Rejected &&
                !personInApp.Cancelled)
            {
                return(VisaState.VISA_EXT_OFFICE);
            }
            // TO MINISTERY
            if (personInApp.Application.ApplicationState == ApplicationStateEnum.ToMinistery &&
                !personInApp.Cancelled &&
                !personInApp.Rejected &&
                !personInApp.IsComplete)
            {
                return(VisaState.VISA_EXT_TO_MINISTERY);
            }

            // FROM MINISTERY
            if (personInApp.Application.ApplicationState == ApplicationStateEnum.FromMinistery &&
                !personInApp.Cancelled &&
                !personInApp.Rejected &&
                !personInApp.IsComplete)
            {
                return(VisaState.VISA_EXT_FROM_MINISTERY);
            }

            //EXTENTION ON PROCESS
            if (personInApp.Application.SubType == SubType.ApplicationForVisaExtention &&
                personInApp.Application.ApplicationState == ApplicationStateEnum.OnProcess &&
                !personInApp.IsComplete &&
                !personInApp.Rejected &&
                !personInApp.Cancelled)
            {
                return(VisaState.VISA_EXT_ONPROCESS);
            }
            //EXTENDED BY PERSON IN APP
            if ((personInApp.IsComplete | personInApp.Application.ApplicationState == ApplicationStateEnum.Processed) && personInApp.Application.SubType == SubType.ApplicationForVisaExtention)
            {
                return(VisaState.VISA_EXTENDED);
            }

            //EXTENDED BY APPICATION
            if (personInApp.Application.SubType == SubType.ApplicationForVisaExtention &&
                (personInApp.Application.ApplicationState == ApplicationStateEnum.Processed
                 | personInApp.Application.IsComplete))
            {
                return(VisaState.VISA_EXTENDED);
            }

            //CANCELLED BY PERSON IN APP
            if ((personInApp.IsComplete | personInApp.Application.ApplicationState == ApplicationStateEnum.Processed) &&
                personInApp.Application.BaseApplicationType.TypeOfBaseApplication == AppType.Cancelling)
            {
                return(VisaState.VISA_CANCELLED);
            }



            //CANCELLED office
            if ((personInApp.Application.BaseApplicationType.TypeOfBaseApplication == AppType.Cancelling) &&
                (personInApp.Application.ApplicationState == ApplicationStateEnum.Office &&
                 !personInApp.IsComplete &&
                 !personInApp.Rejected &&
                 !personInApp.Cancelled))
            {
                return(VisaState.VISA_CAN_OFFICE);
            }

            //CANCELLED CANCELLED
            if ((personInApp.Application.BaseApplicationType.TypeOfBaseApplication == AppType.Cancelling) &&
                (personInApp.Application.ApplicationState == ApplicationStateEnum.Processed
                 | personInApp.IsComplete))
            {
                return(VisaState.VISA_CANCELLED);
            }



            if (visa.RemainingDays <= 0)
            {
                return(VisaState.VISA_EXPIRED);
            }

            if (visa.RemainingDays >= 1)
            {
                return(VisaState.VISA_VALID);
            }



            else
            {
                return(unknown);
            }
        }