Exemplo n.º 1
0
        public void Load()
        {
            if (ID != -1)
            {
                IDBInterface db = DBInterface.CreatePointer();

                db.StoredProcedure("mile_card_status_select_by_id");
                db.AddParameter("@inIdMileCardStatus", MySql.Data.MySqlClient.MySqlDbType.Int32, ID);
                db.AddOutParameter("@outStatus", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outMinMiles", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outMaxMiles", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outIdAviaCompanyUnion", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outIdAviaCompany", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outNote", MySql.Data.MySqlClient.MySqlDbType.String);

                db.Execute();

                Name   = db.GetOutParameterStr("@outStatus");
                MinVal = db.GetOutParameterInt("@outMinMiles");
                MaxVal = db.GetOutParameterInt("@outMaxMiles");

                Note = db.GetOutParameterStr("@outNote");

                AviaCompanyID      = db.GetOutParameterInt("@outIdAviaCompany");
                AviaCompanyUnionID = db.GetOutParameterInt("@outIdAviaCompanyUnion");

                Changed = false;
            }
        }
Exemplo n.º 2
0
        public void Load()
        {
            if (ID != -1)
            {
                IDBInterface db = DBInterface.CreatePointer();

                db.StoredProcedure("Visa_select_by_id");

                db.AddParameter("@inVisa", MySql.Data.MySqlClient.MySqlDbType.Int32, ID);

                db.AddOutParameter("@outIdPassport", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outName", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outVisaNumber", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outDateOn", MySql.Data.MySqlClient.MySqlDbType.DateTime);
                db.AddOutParameter("@outdateFrom", MySql.Data.MySqlClient.MySqlDbType.DateTime);
                db.AddOutParameter("@outDateUntil", MySql.Data.MySqlClient.MySqlDbType.DateTime);
                db.AddOutParameter("@outIdCountry", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outIdCountryUnion", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outIdCountryEsquire", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outTypeVisa", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outEntriesNumber", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outDaysCount", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outUsedDays", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outIssuedIn", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outIdDocument", MySql.Data.MySqlClient.MySqlDbType.Int32);
                db.AddOutParameter("@outNote", MySql.Data.MySqlClient.MySqlDbType.String);

                db.Execute();

                PassportID = db.GetOutParameterInt("@outIdPassport");
                int countryID = db.GetOutParameterInt("@outIdCountry");
                int unionID   = db.GetOutParameterInt("@outIdCountryUnion");
                CountryOfEmmitationID = db.GetOutParameterInt("@outIdCountryEsquire");
                EntriesNumber         = db.GetOutParameterInt("@outEntriesNumber");
                DaysCount             = db.GetOutParameterInt("@outDaysCount");
                DaysUsed = db.GetOutParameterInt("@outUsedDays");

                OwnerName   = db.GetOutParameterStr("@outName");
                Number      = db.GetOutParameterStr("@outVisaNumber");
                VizaType    = db.GetOutParameterStr("@outTypeVisa");
                Issued      = db.GetOutParameterStr("@outIssuedIn");
                Description = db.GetOutParameterStr("@outNote");

                DateApproved = db.GetOutParameterDateTime("@outDateOn");
                ValidFrom    = db.GetOutParameterDateTime("@outdateFrom");
                ValidTill    = db.GetOutParameterDateTime("@outDateUntil");

                SetTargetCountryOrUnion(countryID, unionID);

                Changed = false;
            }
        }
Exemplo n.º 3
0
        public void Load()
        {
            IDBInterface db = DBInterface.CreatePointer();

            db.StoredProcedure("mile_card_select_by_id");

            db.AddParameter("@inIdMileCard", MySql.Data.MySqlClient.MySqlDbType.Int32, ID);

            db.AddOutParameter("@outIdMileCardStatus", MySql.Data.MySqlClient.MySqlDbType.Int32);
            db.AddOutParameter("@outNumber", MySql.Data.MySqlClient.MySqlDbType.String);
            db.AddOutParameter("@outPassword", MySql.Data.MySqlClient.MySqlDbType.String);
            db.AddOutParameter("@outMilesCount", MySql.Data.MySqlClient.MySqlDbType.Int32);
            db.AddOutParameter("@outIdAviaCompanyUnion", MySql.Data.MySqlClient.MySqlDbType.Int32);
            db.AddOutParameter("@outIdAviaCompany", MySql.Data.MySqlClient.MySqlDbType.Int32);
            db.AddOutParameter("@outIdRespondedPerson", MySql.Data.MySqlClient.MySqlDbType.Int32);
            db.AddOutParameter("@outIdOwnerPerson", MySql.Data.MySqlClient.MySqlDbType.Int32);
            db.AddOutParameter("@outNote", MySql.Data.MySqlClient.MySqlDbType.String);

            db.Execute();

            mileCardStatus.ID = db.GetOutParameterInt("@outIdMileCardStatus");
            mileCardStatus.Load();

            Silent = true;

            Number             = db.GetOutParameterStr("@outNumber");
            Password           = db.GetOutParameterStr("@outPassword");
            MilesCount         = db.GetOutParameterInt("@outMilesCount");
            AviaCompanyUnionID = db.GetOutParameterInt("@outIdAviaCompanyUnion");
            AviaCompanyID      = db.GetOutParameterInt("@outIdAviaCompany");
            PersonRespondedID  = db.GetOutParameterInt("@outIdRespondedPerson");
            Note = db.GetOutParameterStr("@outNote");

            Silent  = false;
            Changed = false;

            if (personOwner.ID != db.GetOutParameterInt("@outIdOwnerPerson"))
            {
                throw new DataException("Mile card doesnt relates to current person");
            }
        }
Exemplo n.º 4
0
        public void Load()
        {
            if (ID != -1)
            {
                IDBInterface db = DBInterface.CreatePointer();

                db.StoredProcedure("Country_union_select_by_id");

                db.AddParameter("@inIdCountryUnion", MySql.Data.MySqlClient.MySqlDbType.Int32, ID);

                db.AddOutParameter("@outUnionName", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outShortUnionName", MySql.Data.MySqlClient.MySqlDbType.String);
                db.AddOutParameter("@outNote", MySql.Data.MySqlClient.MySqlDbType.String);

                db.Execute();


                Name      = db.GetOutParameterStr("@outUnionName");
                ShortName = db.GetOutParameterStr("@outShortUnionName");
                Note      = db.GetOutParameterStr("@outNote");

                Changed = false;
            }
        }