Esempio n. 1
0
        public IHttpActionResult GetFishpondCase(string ticketNumber)
        {
            using (var dbContext = new DataContext())
            {
                var verifyRepository = new VerifyRepository(dbContext, SessionModel.CredentialID, SessionModel.UserName);
                var captureTypes     = new List <VerifyRepository.sCaptureTypes>();
                var @case            = new VerifyRepository.sCaseInfo();

                if (!verifyRepository.fishpondGetCase(ticketNumber, ref @case, ref captureTypes))
                {
                    return(this.BadRequestEx(Error.PopulateMethodFailed(verifyRepository.Error)));
                }

                return(Ok(
                           new FishpondCaseModel
                {
                    // TODO
                }));
            }
        }
Esempio n. 2
0
        public IHttpActionResult RejectFishpondCase(CaseModel model, int reasonID, bool registrationNumberChanged, bool addressChanged, bool personChanged, int typeID, decimal typeAmount, string computerName)
        {
            using (var dbContext = new DataContext())
            {
                var verifyRepository = new VerifyRepository(dbContext, SessionModel.CredentialID, SessionModel.UserName);
                var caseInfo         = new VerifyRepository.sCaseInfo();
                caseInfo.mImage1                   = model.Image1;
                caseInfo.mImage1ID                 = model.Image1ID;
                caseInfo.mImage2                   = model.Image2;
                caseInfo.mImage2ID                 = model.Image2ID;
                caseInfo.mImage3                   = model.Image3;
                caseInfo.mImage3ID                 = model.Image3ID;
                caseInfo.mImage4                   = model.Image4;
                caseInfo.mImage4ID                 = model.Image4ID;
                caseInfo.mImageNP                  = model.ImageNP;
                caseInfo.mNatisPhysical            = model.NatisPhysical.ToEntity();
                caseInfo.mNatisPostal              = model.NatisPostal.ToEntity();
                caseInfo.mOffenceDate              = model.OffenceDate;
                caseInfo.mOffenceNewNotes          = model.OffenceNewNotes;
                caseInfo.mOffenceOldNotes          = model.OffenceOldNotes;
                caseInfo.mOnlyOneImage             = model.OnlyOneImage;
                caseInfo.mPersonID                 = model.PersonID;
                caseInfo.mPersonKey                = model.PersonKey;
                caseInfo.mPersonMiddleNames        = model.PersonMiddleNames;
                caseInfo.mPersonName               = model.PersonName;
                caseInfo.mPersonPhysicalAddressKey = model.PersonPhysicalAddressKey;
                caseInfo.mPersonPostalAddressKey   = model.PersonPostalAddressKey;
                caseInfo.mPersonSurname            = model.PersonSurname;
                caseInfo.mPersonTelephone          = model.PersonTelephone;
                caseInfo.mPrintImageNo             = model.PrintImageNo;
                caseInfo.mSystemPhysical           = model.SystemPhysical.ToEntity();
                caseInfo.mSystemPostal             = model.SystemPostal.ToEntity();

                if (!verifyRepository.fishpondCaseReject(caseInfo, reasonID, registrationNumberChanged, addressChanged, personChanged, typeID, typeAmount))
                {
                    return(this.BadRequestEx(Error.PopulateMethodFailed(verifyRepository.Error)));
                }

                return(Ok());
            }
        }
Esempio n. 3
0
        public IHttpActionResult AcceptSummons([FromBody] CaseModel model, bool addressChanged, bool personChanged, string computerName)
        {
            using (var dbContext = new DataContext())
            {
                var verifyRepository = new VerifyRepository(dbContext, SessionModel.CredentialID, SessionModel.UserName);

                var caseInfo = new VerifyRepository.sCaseInfo();
                caseInfo.mImage1                   = model.Image1;
                caseInfo.mImage1ID                 = model.Image1ID;
                caseInfo.mImage2                   = model.Image2;
                caseInfo.mImage2ID                 = model.Image2ID;
                caseInfo.mImage3                   = model.Image3;
                caseInfo.mImage3ID                 = model.Image3ID;
                caseInfo.mImage4                   = model.Image4;
                caseInfo.mImage4ID                 = model.Image4ID;
                caseInfo.mImageNP                  = model.ImageNP;
                caseInfo.mNatisPhysical            = model.NatisPhysical.ToEntity();
                caseInfo.mNatisPostal              = model.NatisPostal.ToEntity();
                caseInfo.mOffenceDate              = model.OffenceDate;
                caseInfo.mOffenceNewNotes          = model.OffenceNewNotes;
                caseInfo.mOffenceOldNotes          = model.OffenceOldNotes;
                caseInfo.mOnlyOneImage             = model.OnlyOneImage;
                caseInfo.mPersonID                 = model.PersonID;
                caseInfo.mPersonKey                = model.PersonKey;
                caseInfo.mPersonMiddleNames        = model.PersonMiddleNames;
                caseInfo.mPersonName               = model.PersonName;
                caseInfo.mPersonPhysicalAddressKey = model.PersonPhysicalAddressKey;
                caseInfo.mPersonPostalAddressKey   = model.PersonPostalAddressKey;
                caseInfo.mPersonSurname            = model.PersonSurname;
                caseInfo.mPersonTelephone          = model.PersonTelephone;
                caseInfo.mPrintImageNo             = model.PrintImageNo;
                caseInfo.mSystemPhysical           = model.SystemPhysical.ToEntity();
                caseInfo.mSystemPostal             = model.SystemPostal.ToEntity();

                if (!verifyRepository.summonsAccept(ref caseInfo, addressChanged, personChanged))
                {
                    return(this.BadRequestEx(Error.PopulateMethodFailed(verifyRepository.Error)));
                }

                return(Ok(
                           new CaseModel
                {
                    Image1 = caseInfo.mImage1,
                    Image1ID = caseInfo.mImage1ID,
                    Image2 = caseInfo.mImage2,
                    Image2ID = caseInfo.mImage2ID,
                    Image3 = caseInfo.mImage3,
                    Image3ID = caseInfo.mImage3ID,
                    Image4 = caseInfo.mImage4,
                    Image4ID = caseInfo.mImage4ID,
                    ImageNP = caseInfo.mImageNP,
                    NatisPhysical = caseInfo.mNatisPhysical.ToModel(),
                    NatisPostal = caseInfo.mNatisPostal.ToModel(),
                    OffenceDate = caseInfo.mOffenceDate,
                    OffenceNewNotes = caseInfo.mOffenceNewNotes,
                    OffenceOldNotes = caseInfo.mOffenceOldNotes,
                    OnlyOneImage = caseInfo.mOnlyOneImage,
                    PersonID = caseInfo.mPersonID,
                    PersonKey = caseInfo.mPersonKey,
                    PersonMiddleNames = caseInfo.mPersonMiddleNames,
                    PersonName = caseInfo.mPersonName,
                    PersonPhysicalAddressKey = caseInfo.mPersonPhysicalAddressKey,
                    PersonPostalAddressKey = caseInfo.mPersonPostalAddressKey,
                    PersonSurname = caseInfo.mPersonSurname,
                    PersonTelephone = caseInfo.mPersonTelephone,
                    PrintImageNo = caseInfo.mPrintImageNo,
                    SystemPhysical = caseInfo.mSystemPhysical.ToModel(),
                    SystemPostal = caseInfo.mSystemPostal.ToModel(),
                    TicketNo = caseInfo.mTicketNo,
                    UseGismoAddress = caseInfo.mUseGismoAddress,
                    VehicleCaptureType = caseInfo.mVehicleCaptureType,
                    VehicleColour = caseInfo.mVehicleColour,
                    VehicleMake = caseInfo.mVehicleMake,
                    VehicleModel = caseInfo.mVehicleModel,
                    VehicleRegNo = caseInfo.mVehicleRegNo,
                    VehicleRegNoConfirmed = caseInfo.mVehicleRegNoConfirmed,
                    VehicleType = caseInfo.mVehicleType,
                    IsNumberPlateCentralCaptured = verifyRepository.pNPCapturedOnCentral,
                    NumberPlateCentralPath = verifyRepository.pNPCapturePath
                }));
            }
        }
Esempio n. 4
0
        public IHttpActionResult CheckAddress([FromBody] CaseModel model, bool isSummons)
        {
            using (var dbContext = new DataContext())
            {
                var verifyRepository = new VerifyRepository(dbContext, SessionModel.CredentialID, SessionModel.UserName);
                var caseInfo         = new VerifyRepository.sCaseInfo();

                caseInfo.mImage1                   = model.Image1;
                caseInfo.mImage1ID                 = model.Image1ID;
                caseInfo.mImage2                   = model.Image2;
                caseInfo.mImage2ID                 = model.Image2ID;
                caseInfo.mImage3                   = model.Image3;
                caseInfo.mImage3ID                 = model.Image3ID;
                caseInfo.mImage4                   = model.Image4;
                caseInfo.mImage4ID                 = model.Image4ID;
                caseInfo.mImageNP                  = model.ImageNP;
                caseInfo.mNatisPhysical            = model.NatisPhysical.ToEntity();
                caseInfo.mNatisPostal              = model.NatisPostal.ToEntity();
                caseInfo.mOffenceDate              = model.OffenceDate;
                caseInfo.mOffenceNewNotes          = model.OffenceNewNotes;
                caseInfo.mOffenceOldNotes          = model.OffenceOldNotes;
                caseInfo.mOnlyOneImage             = model.OnlyOneImage;
                caseInfo.mPersonID                 = model.PersonID;
                caseInfo.mPersonKey                = model.PersonKey;
                caseInfo.mPersonMiddleNames        = model.PersonMiddleNames;
                caseInfo.mPersonName               = model.PersonName;
                caseInfo.mPersonPhysicalAddressKey = model.PersonPhysicalAddressKey;
                caseInfo.mPersonPostalAddressKey   = model.PersonPostalAddressKey;
                caseInfo.mPersonSurname            = model.PersonSurname;
                caseInfo.mPersonTelephone          = model.PersonTelephone;
                caseInfo.mPrintImageNo             = model.PrintImageNo;
                caseInfo.mSystemPhysical           = model.SystemPhysical.ToEntity();
                caseInfo.mSystemPostal             = model.SystemPostal.ToEntity();


                if (!verifyRepository.checkAddress(ref caseInfo, isSummons))
                {
                    return(this.BadRequestEx(Error.PopulateMethodFailed(verifyRepository.Error)));
                }


                return(Ok(
                           new CaseModel
                {
                    Image1 = caseInfo.mImage1,
                    Image1ID = caseInfo.mImage1ID,
                    Image2 = caseInfo.mImage2,
                    Image2ID = caseInfo.mImage2ID,
                    Image3 = caseInfo.mImage3,
                    Image3ID = caseInfo.mImage3ID,
                    Image4 = caseInfo.mImage4,
                    Image4ID = caseInfo.mImage4ID,
                    ImageNP = caseInfo.mImageNP,
                    NatisPhysical = caseInfo.mNatisPhysical.ToModel(),
                    NatisPostal = caseInfo.mNatisPostal.ToModel(),
                    OffenceDate = caseInfo.mOffenceDate,
                    OffenceNewNotes = caseInfo.mOffenceNewNotes,
                    OffenceOldNotes = caseInfo.mOffenceOldNotes,
                    OnlyOneImage = caseInfo.mOnlyOneImage,
                    PersonID = caseInfo.mPersonID,
                    PersonKey = caseInfo.mPersonKey,
                    PersonMiddleNames = caseInfo.mPersonMiddleNames,
                    PersonName = caseInfo.mPersonName,
                    PersonPhysicalAddressKey = caseInfo.mPersonPhysicalAddressKey,
                    PersonPostalAddressKey = caseInfo.mPersonPostalAddressKey,
                    PersonSurname = caseInfo.mPersonSurname,
                    PersonTelephone = caseInfo.mPersonTelephone,
                    PrintImageNo = caseInfo.mPrintImageNo,
                    SystemPhysical = caseInfo.mSystemPhysical.ToModel(),
                    SystemPostal = caseInfo.mSystemPostal.ToModel(),
                    IsNumberPlateCentralCaptured = verifyRepository.pNPCapturedOnCentral,
                    NumberPlateCentralPath = verifyRepository.pNPCapturePath
                }));
            }
        }
Esempio n. 5
0
        public IHttpActionResult RejectCase(CaseModel model, int reasonID, bool registrationNumberChanged, bool addressChanged, bool personChanged, int typeID, decimal typeAmount, string computerName)
        {
            using (var dbContext = new DataContext())
            {
                var verifyRepository = new VerifyRepository(dbContext, SessionModel.CredentialID, SessionModel.UserName);
                var captureTypes     = new List <VerifyRepository.sCaptureTypes>();
                var count            = 0;
                var caseInfo         = new VerifyRepository.sCaseInfo();
                caseInfo.mImage1                   = model.Image1;
                caseInfo.mImage1ID                 = model.Image1ID;
                caseInfo.mImage2                   = model.Image2;
                caseInfo.mImage2ID                 = model.Image2ID;
                caseInfo.mImage3                   = model.Image3;
                caseInfo.mImage3ID                 = model.Image3ID;
                caseInfo.mImage4                   = model.Image4;
                caseInfo.mImage4ID                 = model.Image4ID;
                caseInfo.mImageNP                  = model.ImageNP;
                caseInfo.mNatisPhysical            = model.NatisPhysical.ToEntity();
                caseInfo.mNatisPostal              = model.NatisPostal.ToEntity();
                caseInfo.mOffenceDate              = model.OffenceDate;
                caseInfo.mOffenceNewNotes          = model.OffenceNewNotes;
                caseInfo.mOffenceOldNotes          = model.OffenceOldNotes;
                caseInfo.mOnlyOneImage             = model.OnlyOneImage;
                caseInfo.mPersonID                 = model.PersonID;
                caseInfo.mPersonKey                = model.PersonKey;
                caseInfo.mPersonMiddleNames        = model.PersonMiddleNames;
                caseInfo.mPersonName               = model.PersonName;
                caseInfo.mPersonPhysicalAddressKey = model.PersonPhysicalAddressKey;
                caseInfo.mPersonPostalAddressKey   = model.PersonPostalAddressKey;
                caseInfo.mPersonSurname            = model.PersonSurname;
                caseInfo.mPersonTelephone          = model.PersonTelephone;
                caseInfo.mPrintImageNo             = model.PrintImageNo;
                caseInfo.mSystemPhysical           = model.SystemPhysical.ToEntity();
                caseInfo.mSystemPostal             = model.SystemPostal.ToEntity();


                if (!verifyRepository.caseReject(ref caseInfo, reasonID, registrationNumberChanged, addressChanged, personChanged, typeID, typeAmount, ref captureTypes, out count))
                {
                    return(this.BadRequestEx(Error.PopulateMethodFailed(verifyRepository.Error)));
                }

                return(Ok(
                           new FirstCaseModel
                {
                    Case = new CaseModel
                    {
                        Image1 = caseInfo.mImage1,
                        Image1ID = caseInfo.mImage1ID,
                        Image2 = caseInfo.mImage2,
                        Image2ID = caseInfo.mImage2ID,
                        Image3 = caseInfo.mImage3,
                        Image3ID = caseInfo.mImage3ID,
                        Image4 = caseInfo.mImage4,
                        Image4ID = caseInfo.mImage4ID,
                        ImageNP = caseInfo.mImageNP,
                        NatisPhysical = caseInfo.mNatisPhysical.ToModel(),
                        NatisPostal = caseInfo.mNatisPostal.ToModel(),
                        OffenceDate = caseInfo.mOffenceDate,
                        OffenceNewNotes = caseInfo.mOffenceNewNotes,
                        OffenceOldNotes = caseInfo.mOffenceOldNotes,
                        OnlyOneImage = caseInfo.mOnlyOneImage,
                        PersonID = caseInfo.mPersonID,
                        PersonKey = caseInfo.mPersonKey,
                        PersonMiddleNames = caseInfo.mPersonMiddleNames,
                        PersonName = caseInfo.mPersonName,
                        PersonPhysicalAddressKey = caseInfo.mPersonPhysicalAddressKey,
                        PersonPostalAddressKey = caseInfo.mPersonPostalAddressKey,
                        PersonSurname = caseInfo.mPersonSurname,
                        PersonTelephone = caseInfo.mPersonTelephone,
                        PrintImageNo = caseInfo.mPrintImageNo,
                        SystemPhysical = caseInfo.mSystemPhysical.ToModel(),
                        SystemPostal = caseInfo.mSystemPostal.ToModel(),
                        TicketNo = caseInfo.mTicketNo,
                        UseGismoAddress = caseInfo.mUseGismoAddress,
                        VehicleCaptureType = caseInfo.mVehicleCaptureType,
                        VehicleColour = caseInfo.mVehicleColour,
                        VehicleMake = caseInfo.mVehicleMake,
                        VehicleModel = caseInfo.mVehicleModel,
                        VehicleRegNo = caseInfo.mVehicleRegNo,
                        VehicleRegNoConfirmed = caseInfo.mVehicleRegNoConfirmed,
                        VehicleType = caseInfo.mVehicleType,
                        IsNumberPlateCentralCaptured = verifyRepository.pNPCapturedOnCentral,
                        NumberPlateCentralPath = verifyRepository.pNPCapturePath
                    },
                    CaptureTypes = captureTypes.Select(f => new CaptureTypeModel {
                        ID = f.mID, Amount = f.mAmount, Description = f.mDescription
                    }).ToList(),
                    Count = count
                }));
            }
        }
Esempio n. 6
0
        public IHttpActionResult GetFirstCase()
        {
            using (var dbContext = new DataContext())
            {
                var verifyRepository = new VerifyRepository(dbContext, SessionModel.CredentialID, SessionModel.UserName);
                var rejectReasons    = new List <VerifyRepository.sRejectReasons>();
                var captureTypes     = new List <VerifyRepository.sCaptureTypes>();
                var caseInfo         = new VerifyRepository.sCaseInfo();
                var count            = 0;

                if (!verifyRepository.caseFirst(ref rejectReasons, ref captureTypes, out count, ref caseInfo))
                {
                    return(this.BadRequestEx(Error.PopulateMethodFailed(verifyRepository.Error)));
                }

                return(Ok(
                           new FirstCaseModel
                {
                    Case = new CaseModel
                    {
                        Image1 = caseInfo.mImage1,
                        Image1ID = caseInfo.mImage1ID,
                        Image2 = caseInfo.mImage2,
                        Image2ID = caseInfo.mImage2ID,
                        Image3 = caseInfo.mImage3,
                        Image3ID = caseInfo.mImage3ID,
                        Image4 = caseInfo.mImage4,
                        Image4ID = caseInfo.mImage4ID,
                        ImageNP = caseInfo.mImageNP,
                        NatisPhysical = caseInfo.mNatisPhysical.ToModel(),
                        NatisPostal = caseInfo.mNatisPostal.ToModel(),
                        OffenceDate = caseInfo.mOffenceDate,
                        OffenceNewNotes = caseInfo.mOffenceNewNotes,
                        OffenceOldNotes = caseInfo.mOffenceOldNotes,
                        OnlyOneImage = caseInfo.mOnlyOneImage,
                        PersonID = caseInfo.mPersonID,
                        PersonKey = caseInfo.mPersonKey,
                        PersonMiddleNames = caseInfo.mPersonMiddleNames,
                        PersonName = caseInfo.mPersonName,
                        PersonPhysicalAddressKey = caseInfo.mPersonPhysicalAddressKey,
                        PersonPostalAddressKey = caseInfo.mPersonPostalAddressKey,
                        PersonSurname = caseInfo.mPersonSurname,
                        PersonTelephone = caseInfo.mPersonTelephone,
                        PrintImageNo = caseInfo.mPrintImageNo,
                        SystemPhysical = caseInfo.mSystemPhysical.ToModel(),
                        SystemPostal = caseInfo.mSystemPostal.ToModel(),
                        TicketNo = caseInfo.mTicketNo,
                        UseGismoAddress = caseInfo.mUseGismoAddress,
                        VehicleCaptureType = caseInfo.mVehicleCaptureType,
                        VehicleColour = caseInfo.mVehicleColour,
                        VehicleMake = caseInfo.mVehicleMake,
                        VehicleModel = caseInfo.mVehicleModel,
                        VehicleRegNo = caseInfo.mVehicleRegNo,
                        VehicleRegNoConfirmed = caseInfo.mVehicleRegNoConfirmed,
                        VehicleType = caseInfo.mVehicleType,
                        IsNumberPlateCentralCaptured = verifyRepository.pNPCapturedOnCentral,
                        NumberPlateCentralPath = verifyRepository.pNPCapturePath
                    },
                    CaptureTypes = captureTypes.Select(f => new CaptureTypeModel {
                        ID = f.mID, Amount = f.mAmount, Description = f.mDescription
                    }).ToList(),
                    Count = count,
                    RejectReasons = rejectReasons.Select(f => new RejectReasonModel {
                        ID = f.mID, Description = f.mDescription
                    }).ToList()
                }));
            }
        }