Esempio n. 1
0
        public void TypeInitialise(out sCaptureTypes type)
        {
            type.mID = -1;

            type.mCode        = string.Empty;
            type.mType        = string.Empty;
            type.mDescription = string.Empty;
            type.mBeskrywing  = string.Empty;
            type.mAmount      = 0;
        }
Esempio n. 2
0
        private string VehicleXML(sCaptureTypes capType, sCaseInfo caseInfo, int officerID)
        {
            string xml = "<main> ";

            xml += "<DATA_RECORD> ";
            xml += "<ID>" + capType.mID.ToString() + "</ID> ";
            xml += "<ZONE>" + caseInfo.mOffenceZone.ToString() + "</ZONE> ";
            xml += "<SPEED>" + caseInfo.mOffenceSpeed.ToString() + "</SPEED> ";
            xml += "<AMOUNT>" + capType.mAmount.ToString("0.00") + "</AMOUNT> ";
            xml += "<DESCRIPTION>" + XmlClean(capType.mDescription) + "</DESCRIPTION> ";
            xml += "<BESKRYWING>" + XmlClean(capType.mBeskrywing) + "</BESKRYWING> ";
            xml += "<INF_DATE>" + caseInfo.mOffenceDate + "</INF_DATE> ";
            xml += "<VEHICLE_REG>" + caseInfo.mVehicleRegNo + "</VEHICLE_REG> ";
            xml += "<OFFICER_ID>" + officerID.ToString() + "</OFFICER_ID> ";
            //xml += "<USER_ID>" + mOperatorID.ToString() + "</USER_ID> ";
            xml += "</DATA_RECORD> ";
            xml += "</main>";

            return(xml);
        }
Esempio n. 3
0
        public bool CaseAccept(sSessionInfo session, int offenceSet, int fileNumber, int nextFileNumber, int officerID, string sheetNo, bool sheetNoChanged, ref sCaseInfo caseInfo, ref sCaseInfo remoteCaseInfo, sCaptureTypes capType, ref List <sCaptureTypes> types, int printImageID, string computerName)
        {
            _error = string.Empty;

            types.Clear();

            try
            {
                OracleParameter par;
                var             cmd = new OracleCommand("ITS.OFFENCE_CAPTURE.accept_cap_multi_image", DbConnection);
                cmd.CommandType = CommandType.StoredProcedure;

                // Inputs
                par              = new OracleParameter("P_USER_ID", _credentialID);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Int32;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_USER_NAME", _credentialUsername);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_COMPUTER_NAME", computerName);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_OFFENCE_SET", offenceSet);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Int32;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_CAM_DATE", session.mCamDate);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_CAM_SESSION", session.mCamSession);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_LOCATION_CODE", session.mLocationCode);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par           = new OracleParameter("P_FILE_NUMBER", fileNumber);
                par.Direction = ParameterDirection.Input;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_NEXT_FILE_NUMBER", nextFileNumber);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Int32;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_VEHICLE_XML", VehicleXML(capType, caseInfo, officerID));
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_PRINT_IMAGE_ID", printImageID);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Int32;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_FIELD_SHEET_NO", sheetNo);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Varchar2;
                cmd.Parameters.Add(par);
                par              = new OracleParameter("P_FIELD_SHEET_CHANGE", sheetNoChanged ? 1 : 0);
                par.Direction    = ParameterDirection.Input;
                par.OracleDbType = OracleDbType.Int32;
                cmd.Parameters.Add(par);

                // Outputs
                cmd.Parameters.Add(new OracleParameter("O_VEHICLE_CURSOR", OracleDbType.RefCursor, 0, ParameterDirection.Output, true, 0, 0, "", DataRowVersion.Current, "O_VEHICLE_CURSOR"));
                cmd.Parameters.Add(new OracleParameter("O_LOCAL_IMAGE_CURSOR", OracleDbType.RefCursor, 0, ParameterDirection.Output, true, 0, 0, "", DataRowVersion.Current, "O_LOCAL_IMAGE_CURSOR"));
                cmd.Parameters.Add(new OracleParameter("O_REMOTE_IMAGE_CURSOR", OracleDbType.RefCursor, 0, ParameterDirection.Output, true, 0, 0, "", DataRowVersion.Current, "O_REMOTE_IMAGE_CURSOR"));
                cmd.Parameters.Add(new OracleParameter("O_ALT_VEHICLE_CURSOR", OracleDbType.RefCursor, 0, ParameterDirection.Output, true, 0, 0, "", DataRowVersion.Current, "O_ALT_VEHICLE_CURSOR"));

                CaseInitialise(out caseInfo);

                cmd.ExecuteNonQuery();

                if (nextFileNumber != -1) // Not last ticket
                {
                    if (!VehicleFromCursor((OracleRefCursor)cmd.Parameters["O_VEHICLE_CURSOR"].Value, ref caseInfo))
                    {
                        return(false);
                    }

                    if (!ImagesFromCursor((OracleRefCursor)cmd.Parameters["O_LOCAL_IMAGE_CURSOR"].Value, ref caseInfo))
                    {
                        return(false);
                    }

                    if (!ImagesFromCursor((OracleRefCursor)cmd.Parameters["O_REMOTE_IMAGE_CURSOR"].Value, ref remoteCaseInfo))
                    {
                        return(false);
                    }

                    if (!TypesFromCursor((OracleRefCursor)cmd.Parameters["O_ALT_VEHICLE_CURSOR"].Value, ref types))
                    {
                        return(false);
                    }
                }

                cmd.Dispose();
            }
            catch (Exception ex)
            {
                _error = ex.Message;
                ErrorCheckFriendly();
                return(false);
            }

            return(true);
        }