public IActionResult Post([FromBody] Purchaser purchaser)
        {
            _repository.Add(purchaser);
            _repository.SaveAll();

            return(Ok());
        }
예제 #2
0
        internal void delete(PersonalAssistant pa, Purchaser p)
        {
            NpgsqlConnection con = DB.DBConnector.GetConnection();
            NpgsqlCommand    cmd = new NpgsqlCommand(null, con);

            try
            {
                cmd.CommandText = "DELETE FROM Dienstverhaeltnis WHERE \"agid\"=@agid AND \"paid\"=@paid";

                DB.DBConnector.AddToCommand("@agid", NpgsqlTypes.NpgsqlDbType.Numeric, cmd, p.Id);
                DB.DBConnector.AddToCommand("@paid", NpgsqlTypes.NpgsqlDbType.Numeric, cmd, pa.Id);


                try { cmd.ExecuteNonQuery(); } catch (Exception e) { MessageBox.Show(e.Message.ToString(), "Error"); }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString(), "Error");
            }

            /*
             * NpgsqlCommand commit = new NpgsqlCommand(null, con);
             * commit.CommandText = "COMMIT";
             * cmd.ExecuteNonQuery();
             */
            con.Close();
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("PurchaserID,FirstName,LastName,Address,Phone,DOB")] Purchaser purchaser)
        {
            if (id != purchaser.PurchaserID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(purchaser);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PurchaserExists(purchaser.PurchaserID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(purchaser));
        }
예제 #4
0
        public static Purchaser PurchaserInfoById(Purchaser obj)
        {
            Purchaser Purchaser = new Purchaser();

            try
            {
                DataTable dtCompradores = new DataTable();

                dtCompradores = DataPurchaser.PurchaserInfoById(obj);
                if (dtCompradores.Rows.Count > 0)
                {
                    Purchaser.IdSegas            = dtCompradores.Rows[0]["IdSegas"] == null ? 0 : Convert.ToInt32(dtCompradores.Rows[0]["IdSegas"]);;
                    Purchaser.Nombre             = dtCompradores.Rows[0]["Nombre"].ToString();
                    Purchaser.Estado             = dtCompradores.Rows[0]["Estado"] == DBNull.Value ? false : Convert.ToBoolean(dtCompradores.Rows[0]["Estado"]);
                    Purchaser.Cubrimiento        = dtCompradores.Rows[0]["Cubrimiento"] == DBNull.Value ? false : Convert.ToBoolean(dtCompradores.Rows[0]["Cubrimiento"]);
                    Purchaser.Listas             = dtCompradores.Rows[0]["Listas"] == DBNull.Value ? false : Convert.ToBoolean(dtCompradores.Rows[0]["Listas"]);
                    Purchaser.IdSubasta          = dtCompradores.Rows[0]["IdSubasta"] == DBNull.Value ? 0 : Convert.ToInt32(dtCompradores.Rows[0]["IdSubasta"]);
                    Purchaser.DemandaMaximaTotal = dtCompradores.Rows[0]["DemandaMaximaTotal"] == DBNull.Value ? 0 : Convert.ToDecimal(dtCompradores.Rows[0]["DemandaMaximaTotal"]);
                }
                return(Purchaser);
            }
            catch (Exception ex)
            {
                GasLogB.CrearLogError(ex);
            }
            return(Purchaser);
        }
예제 #5
0
        public static List <Purchaser> PurchasersInfo(Auction obj)
        {
            List <Purchaser> PurchaserList = new List <Purchaser>();

            try
            {
                DataTable dtCompradores = new DataTable();

                dtCompradores = DataPurchaser.PurchasersInfo(obj);
                foreach (DataRow dr in dtCompradores.Rows)
                {
                    Purchaser Purchaser = new Purchaser();
                    Purchaser.IdSegas            = dr["IdSegas"] == null ? 0 : Convert.ToInt32(dr["IdSegas"]);;
                    Purchaser.Nombre             = dr["Nombre"].ToString();
                    Purchaser.DemandaMaximaTotal = dr["DemandaMaximaTotal"] == DBNull.Value ? 0 : Convert.ToDecimal(dr["DemandaMaximaTotal"]);
                    Purchaser.Estado             = dr["Estado"] == DBNull.Value ? false : Convert.ToBoolean(dr["Estado"]);
                    Purchaser.Cubrimiento        = dr["Cubrimiento"] == DBNull.Value ? false : Convert.ToBoolean(dr["Cubrimiento"]);
                    Purchaser.Listas             = dr["Listas"] == DBNull.Value ? false : Convert.ToBoolean(dr["Listas"]);
                    Purchaser.IdSubasta          = dr["IdSubasta"] == DBNull.Value ? 0 : Convert.ToInt32(dr["IdSubasta"]);
                    Purchaser.IdOperador         = dr["IdOperador"] == DBNull.Value ? 0 : Convert.ToInt32(dr["IdOperador"]);
                    PurchaserList.Add(Purchaser);
                }
                return(PurchaserList);
            }
            catch (Exception ex)
            {
                GasLogB.CrearLogError(ex);
            }
            return(PurchaserList);
        }
예제 #6
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (GridÜbersicht.SelectedIndex != -1)
            {
                Purchaser p = new Purchaser();
                p.Id        = Data[GridÜbersicht.SelectedIndex].Id;
                p.FirstName = Data[GridÜbersicht.SelectedIndex].FirstName;
                p.LastName  = Data[GridÜbersicht.SelectedIndex].LastName;

                if (newPA != null)
                {
                    newPA.employedPurchasers.Add(p);
                    newPA.addedAGs.Add(p);
                    newPA.guiListEmployed.Add(new Track(p.Id, p.FirstName, p.LastName));
                    newPA.AGListe.ItemsSource = newPA.guiListEmployed;
                }
                else if (editPA != null)
                {
                    editPA.employedPurchasers.Add(p);
                    editPA.addedAGs.Add(p);
                    editPA.guiListEmployed.Add(new Track(p.Id, p.FirstName, p.LastName));
                    editPA.AGListe.ItemsSource = editPA.guiListEmployed;
                }

                this.Close();
            }
        }
예제 #7
0
        public async Task UpdatePurchaserReturnsBadResultIfSPurchaserAndIdDoNotMatch()
        {
            // arrange
            PurchaserService purchaserService = new PurchaserService(_client);
            Purchaser        purchaser        = new Purchaser()
            {
                Id        = 0,
                ProfileId = 0,
                CountryId = 0,
                Profile   = new Profile()
                {
                    Id       = 0,
                    Username = "******",
                    Password = "******",
                    Usertype = 2
                }
            };

            Purchaser createPurchaser = await purchaserService.CreatePurchaser(purchaser);

            // act
            var result = await _client.PutAsJsonAsync($"/api/purchasers/{2}", createPurchaser);

            // assert
            Assert.IsTrue(result.StatusCode == HttpStatusCode.BadRequest);
            await purchaserService.DeletePurchaserForProfile(createPurchaser.ProfileId);
        }
        public static DataTable PurchaserInfoById(Purchaser obj)
        {
            DataSet   dsDatos;
            DataTable dtDatos = new DataTable();

            try
            {
                var      ConectStr  = Tools.ConectionNow.BuildConection(obj.User);
                Database dbeAuction = new Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase(ConectStr);
                //  Database dbeAuction = DatabaseFactory.CreateDatabase("Auction");
                // Crear objeto SP
                DbCommand spComprador = dbeAuction.GetStoredProcCommand("SP_COMPRADORES");
                dbeAuction.AddInParameter(spComprador, "@i_operation", DbType.String, "S");
                dbeAuction.AddInParameter(spComprador, "@i_option", DbType.String, "B");
                dbeAuction.AddInParameter(spComprador, "@id_Comprador", DbType.Int32, obj.IdSegas);
                dbeAuction.AddInParameter(spComprador, "@IdSubasta", DbType.Int32, obj.IdSubasta);
                spComprador.CommandTimeout = 900000000;
                dsDatos = dbeAuction.ExecuteDataSet(spComprador);
                if (dsDatos.Tables[0].Rows.Count > 0)
                {
                    dtDatos = dsDatos.Tables[0];
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(string.Format("AuctionGas ApiWebServices Auditoria: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name));

                throw new Exception((string.Format("AuctionGas ApiWebServices Auditoria: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name)));
            }
            return(dtDatos);
        }
예제 #9
0
        public void employementTimesTest()
        {
            PersonalAssistantDAO paDao      = new PersonalAssistantDAO();
            PurchaserDataDAO     pdDao      = new PurchaserDataDAO();
            PurchaserData        originalPd = d;

            originalPd = pdDao.Insert(originalPd);
            idToDelete = originalPd.Purchaser.Id;
            List <PersonalAssistant> pas = paDao.SelectAll();

            if (pas == null || pas.Count == 0)
            {
                Assert.Fail("Can not find personal assistants to add to purchasers employmentTimes");
            }
            PersonalAssistant pa = pas[0];
            Purchaser         p  = originalPd.Purchaser;

            paDao.insertEmploymentStatus(p, pa);

            //when
            PurchaserDAO            purDao  = new PurchaserDAO();
            List <EmploymentStatus> empList = purDao.SelectEmploymentStatusList(p);

            //then
            Assert.IsNotNull(empList);
            Assert.AreEqual(empList.Count, 1);
            Assert.AreEqual(empList[0].Purchaser.Id, p.Id);
            Assert.AreEqual(empList[0].Assistant.Id, pa.Id);
        }
예제 #10
0
 private void Awake()
 {
     if (purchase == null)
     {
         purchase = this;
     }
 }
예제 #11
0
        public bool CheckAuthoriz(string username, string passwd)
        {
            List <Purchaser> materials = new List <Purchaser>();
            string           cmd       = "select username, passwd from purchasers";
            SqlCommand       command   = new SqlCommand(cmd, connection);
            SqlDataReader    result    = command.ExecuteReader();

            if (result.HasRows)
            {
                while (result.Read())
                {
                    Purchaser purchaser = new Purchaser
                    {
                        username = result.GetString(0),
                        passwd   = result.GetString(1)
                    };
                    materials.Add(purchaser);
                }
                result.Close();

                if (materials.FindAll(x => x.username == username && x.passwd == passwd).Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                result.Close();
                return(false);
            }
        }
예제 #12
0
        public void employingPurchasersTest()
        {
            PersonalAssistantDAO paDao      = new PersonalAssistantDAO();
            PurchaserDataDAO     pdDao      = new PurchaserDataDAO();
            PersonalAssistant    originalPa = pa;

            originalPa = paDao.insert(originalPa);
            idToDelete = originalPa.Id;
            List <PurchaserData> purs = pdDao.SelectAll();

            if (purs == null || purs.Count == 0)
            {
                Assert.Fail("Can not add purchaser to personal assistants purchasersList");
            }
            Purchaser p = purs[0].Purchaser;

            paDao.insertEmploymentStatus(p, originalPa);

            //when
            paDao.selectPurchaserList(originalPa);

            //then
            Assert.IsNotNull(originalPa.Purchasers);
            Assert.AreEqual(originalPa.Purchasers.Count, 1);
            Assert.AreEqual(originalPa.Purchasers[0].Id, p.Id);
        }
예제 #13
0
        public async Task DeleteNonExistingPurchaser()
        {
            // arrange
            HAVIdatabaseContext dbContext  = CreateDbContext();
            PurchaserRepository repository = new PurchaserRepository(dbContext);
            Purchaser           purchaser  = new Purchaser()
            {
                Id        = 1,
                ProfileId = 0,
                CountryId = 0,
                Profile   = new Profile()
                {
                    Id       = 0,
                    Username = "******",
                    Password = "******",
                    Usertype = 2
                }
            };

            // act
            Purchaser result = await repository.DeletePurchaserForProfile(purchaser.ProfileId);

            // assert
            Assert.IsTrue(result == null);

            dbContext.Dispose();
        }
예제 #14
0
        public static bool PurchasersSaveState(Purchaser pucharserobj)
        {
            bool transOk = false;
            int  datos;

            try
            {
                var      ConectStr  = Tools.ConectionNow.BuildConection(pucharserobj.User);
                Database dbeAuction = new Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase(ConectStr);
                //  Database dbeAuction = DatabaseFactory.CreateDatabase("Auction");
                // Crear objeto SP
                DbCommand spComprador = dbeAuction.GetStoredProcCommand("SP_COMPRADORES");
                dbeAuction.AddInParameter(spComprador, "@i_operation", DbType.String, "IU");
                dbeAuction.AddInParameter(spComprador, "@i_option", DbType.String, "B");
                dbeAuction.AddInParameter(spComprador, "@id_Comprador", DbType.Int32, pucharserobj.IdSegas);
                dbeAuction.AddInParameter(spComprador, "@IdSubasta", DbType.Int32, pucharserobj.IdSubasta);
                dbeAuction.AddInParameter(spComprador, "@Estado", DbType.Boolean, pucharserobj.Estado);
                dbeAuction.AddInParameter(spComprador, "@Cubrimiento", DbType.Boolean, pucharserobj.Cubrimiento);
                dbeAuction.AddInParameter(spComprador, "@Listas", DbType.Boolean, pucharserobj.Listas);


                spComprador.CommandTimeout = 900000000;
                datos   = dbeAuction.ExecuteNonQuery(spComprador);
                transOk = true;
            }
            catch (Exception ex)
            {
                transOk = false;
                System.Diagnostics.Trace.WriteLine(string.Format("AuctionGas ApiWebServices Auditoria: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name));

                throw new Exception((string.Format("AuctionGas ApiWebServices Auditoria: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name)));
            }
            return(transOk);
        }
예제 #15
0
        private PurchaseReceipt RecordOrder(Guid ownerId, Order order, Purchaser purchaser, AppleReceipt receipt)
        {
            // Save the order.

            order.OwnerId     = ownerId;
            order.PurchaserId = purchaser.Id;
            _repository.CreateOrder(order);

            // Save the receipt.

            receipt.Prepare();
            receipt.Validate();
            _repository.CreateReceipt(order.Id, receipt);

            // Allocate the credits.

            var products = (from i in order.Items select _productsQuery.GetProduct(i.ProductId)).ToList();

            foreach (var product in products)
            {
                AllocateCredits(order.OwnerId, product, order.Id);
            }

            // Fire events.

            var handlers = OrderPurchased;

            if (handlers != null)
            {
                handlers(this, new OrderPurchasedEventArgs(order, receipt));
            }

            return(receipt);
        }
예제 #16
0
        public async Task GetExistingPurchaserWithProfileFromDatabaseTest()
        {
            // arrange
            HAVIdatabaseContext dbContext  = CreateDbContext();
            PurchaserRepository repository = new PurchaserRepository(dbContext);
            Purchaser           purchaser  = new Purchaser()
            {
                Id        = 0,
                ProfileId = 0,
                CountryId = 0,
                Profile   = new Profile()
                {
                    Id       = 0,
                    Username = "******",
                    Password = "******",
                    Usertype = 2
                }
            };
            Purchaser addedPurchaser = await repository.AddPurchaser(purchaser);

            // act
            Purchaser result = await repository.GetPurchaserForProfile(addedPurchaser.ProfileId);

            // assert
            Assert.IsTrue(result == addedPurchaser);

            dbContext.Dispose();
        }
예제 #17
0
        public List <EffortEntry> GetEntriesByPurchaser(Purchaser p, int month, int year)
        {
            EffortEntryDAO     eDao  = new EffortEntryDAO();
            List <EffortEntry> entry = eDao.GetEntriesByPurchaser(p, month, year);

            return(null);
        }
예제 #18
0
        public async Task GetPurchasersReturnsExistingPurchasers()
        {
            // arrange
            PurchaserService purchaserService = new PurchaserService(_client);
            Purchaser        purchaser        = new Purchaser()
            {
                Id        = 0,
                ProfileId = 0,
                CountryId = 0,
                Profile   = new Profile()
                {
                    Id       = 0,
                    Username = "******",
                    Password = "******",
                    Usertype = 2
                }
            };

            int       expected = 1;
            Purchaser toDelete = await purchaserService.CreatePurchaser(purchaser);

            // act
            List <Purchaser> actual = await purchaserService.GetPurchasers();

            // assert
            Assert.IsTrue(expected == actual.Count);

            await purchaserService.DeletePurchaserForProfile(toDelete.ProfileId);
        }
예제 #19
0
        public async Task CreatePurchaser()
        {
            Purchaser purchaser = new Purchaser()
            {
                CountryId = Id,
                Profile   = new Profile()
            };

            purchaser.Profile.Username = Email;
            purchaser.Profile.Password = "******";
            purchaser.Profile.Usertype = 1;

            Profile testProfile = await ProfileService.GetProfileByUsernameAndpassword(purchaser.Profile.Username, purchaser.Profile.Password);

            if (testProfile.Username == "")
            {
                await PurchaserService.CreatePurchaser(purchaser);

                NavigationManager.NavigateTo($"/user_view/{Id}", true);
            }
            else
            {
                _userAlreadyExists = $"A purchaser with the email '{Email}' already exists";
            }
        }
예제 #20
0
        public List <Purchaser> getPurchasers()
        {
            List <Purchaser> purchasers = new List <Purchaser>();
            string           cmd        = "dbo.PurchaserInfo";
            SqlCommand       command    = new SqlCommand(cmd, connection);

            command.CommandType = System.Data.CommandType.StoredProcedure;
            SqlDataReader result = command.ExecuteReader();

            if (result.HasRows)
            {
                while (result.Read())
                {
                    Purchaser purchaser = new Purchaser
                    {
                        ID    = result.GetInt32(0),
                        name  = result.GetString(1),
                        email = result.GetString(2),
                        //tel_number = result.GetString(3),
                        OrderCount = result.GetInt32(5)
                    };
                    purchasers.Add(purchaser);
                }
            }

            result.Close();
            return(purchasers);
        }
예제 #21
0
        public Purchaser getPurchaser(string username, string passwd)
        {
            string     cmd     = "dbo.PurhaserInfo";
            SqlCommand command = new SqlCommand(cmd, connection);

            command.CommandType = System.Data.CommandType.StoredProcedure;
            command.Parameters.Add(new SqlParameter("@username", username));
            command.Parameters.Add(new SqlParameter("@password", passwd));
            SqlDataReader result    = command.ExecuteReader();
            Purchaser     purchaser = null;

            if (result.HasRows)
            {
                while (result.Read())
                {
                    purchaser = new Purchaser
                    {
                        username = result.GetString(0),
                        passwd   = result.GetString(1)
                    };
                }
                return(purchaser);
            }
            else
            {
                result.Close();
                return(null);
            }
        }
예제 #22
0
 public static PaymentRequestMessage <TTxn> Map <TTxn>(Order order, Purchaser purchaser, CreditCard creditCard, Country country, string merchantId, string password)
     where TTxn : Txn, new()
 {
     return(typeof(TTxn) == typeof(AntiFraudPaymentRequestTxn)
         ? MapAntiFraud(order, purchaser, creditCard, country, merchantId, password) as PaymentRequestMessage <TTxn>
         : MapStandard(order, creditCard, merchantId, password) as PaymentRequestMessage <TTxn>);
 }
예제 #23
0
        public async void NewArticleAdded()
        {
            if (CountryName != null && PurchaserUsername != null)
            {
                Country country = await CountryService.GetCountryWithName(CountryName);

                Profile profile = await ProfileService.GetProfileByUsernameAndpassword(PurchaserUsername, "1234");

                Purchaser purchaser = await PurchaserService.GetPurchaserForProfile(profile.Id);

                Article Article = new Article()
                {
                    PurchaserId                = purchaser.Id,
                    SupplierId                 = Id,
                    CountryId                  = country.Id,
                    VailedForCustomer          = ValidForCustomer,
                    DateCreated                = DateTime.Now,
                    ArticleState               = (int)ArticleState.Created,
                    ArticleInformation         = new ArticleInformation(),
                    InternalArticleInformation = new InternalArticleInformation()
                };

                Article.ArticleInformation.CompanyName           = Supplier.CompanyName;
                Article.ArticleInformation.CompanyLocation       = Supplier.CompanyLocation;
                Article.ArticleInformation.FreightResponsibility = Supplier.FreightResponsibility;
                Article.ArticleInformation.PalletExchange        = Supplier.PalletExchange;
                Article.ArticleInformation.Email = Supplier.Profile.Username;

                Article newArticle = await ArticleService.CreateArticle(Article);

                NavigationManager.NavigateTo($"/supplier_info_form/{newArticle.ArticleInformation.Id}", true);
            }
        }
예제 #24
0
        public async Task UpdateExistingPurchaserInDatabaseTest()
        {
            // arrange
            HAVIdatabaseContext dbContext  = CreateDbContext();
            PurchaserRepository repository = new PurchaserRepository(dbContext);
            Purchaser           purchaser  = new Purchaser()
            {
                Id        = 0,
                ProfileId = 0,
                CountryId = 0,
                Profile   = new Profile()
                {
                    Id       = 0,
                    Username = "******",
                    Password = "******",
                    Usertype = 2
                }
            };
            Purchaser addedPurchaser = await repository.AddPurchaser(purchaser);

            addedPurchaser.Profile.Username = "******";
            addedPurchaser.Profile.Password = "******";

            // act
            Purchaser result = await repository.UpdatePurchaser(addedPurchaser);

            // assert
            Assert.IsTrue(result == addedPurchaser);

            dbContext.Dispose();
        }
예제 #25
0
    private void OnMouseDown()
    {
        Purchaser p = new Purchaser();

        switch (value)
        {
        case 100:
            p.buyCoins100();
            break;

        case 200:
            p.buyCoins200();
            break;

        case 1000:
            p.buyCoins1000();
            break;

        case 10000:
            p.buyCoins10000();
            break;

        case 0:
            p.buyNoAds();
            break;
        }

        int coins = PlayerPrefs.GetInt("coins");

        coinTm.text = "" + (coins + value);
    }
예제 #26
0
        public async Task AddPurchaserToDatabaseTest()
        {
            // arrange
            HAVIdatabaseContext dbContext  = CreateDbContext();
            PurchaserRepository repository = new PurchaserRepository(dbContext);
            Purchaser           purchaser  = new Purchaser()
            {
                Id        = 0,
                ProfileId = 0,
                CountryId = 0,
                Profile   = new Profile()
                {
                    Id       = 0,
                    Username = "******",
                    Password = "******",
                    Usertype = 2
                }
            };

            // act
            Purchaser result = await repository.AddPurchaser(purchaser);

            // assert
            Assert.IsTrue(result.Id > 0);

            dbContext.Dispose();
        }
예제 #27
0
파일: PurchaserDAO.cs 프로젝트: akio4800/fh
        public bool Update(Purchaser person)
        {
            PersonDAO pdao = new PersonDAO();

            pdao.Update(person);

            NpgsqlConnection con = DB.DBConnector.GetConnection();


            NpgsqlCommand command = new NpgsqlCommand(null, con);

            command.CommandText = "UPDATE auftraggeber SET aktiv=@aktiv,bewilligungsanfang=@bewilligungsanfang, bewilligungsende=@bewilligungsende, eintrittsdatum=@eintrittsdatum, kontaktperson=@kontaktperson ,hateinfuehrungskurs=@hateinfuehrungskurs,hatkontrakt=@hatkontrakt, bezirkshauptmannschaft=@bezirkshauptmannschaft WHERE agid=@agid";

            DB.DBConnector.AddToCommand("@agid", NpgsqlTypes.NpgsqlDbType.Numeric, command, person.Id);
            DB.DBConnector.AddToCommand("@aktiv", NpgsqlTypes.NpgsqlDbType.Boolean, command, person.Active);
            DB.DBConnector.AddToCommand("@bewilligungsanfang", NpgsqlTypes.NpgsqlDbType.Date, command, person.ApprovalBegin);
            DB.DBConnector.AddToCommand("@bewilligungsende", NpgsqlTypes.NpgsqlDbType.Date, command, person.ApprovalEnd);
            DB.DBConnector.AddToCommand("@eintrittsdatum", NpgsqlTypes.NpgsqlDbType.Date, command, person.EntryDate);
            DB.DBConnector.AddToCommand("@hateinfuehrungskurs", NpgsqlTypes.NpgsqlDbType.Boolean, command, person.hasIntroCourse);
            DB.DBConnector.AddToCommand("@hatkontrakt", NpgsqlTypes.NpgsqlDbType.Boolean, command, person.hasContract);
            if (person.ContactPerson != null)
            {
                DB.DBConnector.AddToCommand("@kontaktperson", NpgsqlTypes.NpgsqlDbType.Numeric, command, person.ContactPerson.Id);
            }
            else
            {
                DB.DBConnector.AddToCommand("@kontaktperson", NpgsqlTypes.NpgsqlDbType.Numeric, command, null);
            }
            DB.DBConnector.AddToCommand("@bezirkshauptmannschaft", NpgsqlTypes.NpgsqlDbType.Varchar, command, person.DistrictCommision);
            try { command.ExecuteNonQuery(); }catch (Exception e) { MessageBox.Show(e.Message.ToString(), "Error"); }

            con.Close();
            return(true);
        }
예제 #28
0
        public static bool SavePurchaserUser(Purchaser purchaserobj)
        {
            int  datos;
            bool SafeSave;

            try
            {
                var      ConectStr  = Tools.ConectionNow.BuildConection(purchaserobj.User);
                Database dbeAuction = new Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase(ConectStr);
                //  Database dbeAuction = DatabaseFactory.CreateDatabase("Auction");
                // Crear objeto SP
                DbCommand spComprador = dbeAuction.GetStoredProcCommand("SP_COMPRADORES");

                dbeAuction.AddInParameter(spComprador, "@i_operation", DbType.String, "IU");
                dbeAuction.AddInParameter(spComprador, "@i_option", DbType.String, "C");
                dbeAuction.AddInParameter(spComprador, "@id_Comprador", DbType.Int32, purchaserobj.IdSegas);
                dbeAuction.AddInParameter(spComprador, "@Nombre", DbType.String, purchaserobj.Nombre);
                dbeAuction.AddInParameter(spComprador, "@IdSubasta", DbType.Int32, purchaserobj.IdSubasta);
                dbeAuction.AddInParameter(spComprador, "@DemandaMaxima", DbType.Int32, purchaserobj.DemandaMaximaTotal);
                dbeAuction.AddInParameter(spComprador, "@IdOperador", DbType.Int32, purchaserobj.User.CodigoOperador);


                spComprador.CommandTimeout = 900000000;
                datos    = dbeAuction.ExecuteNonQuery(spComprador);
                SafeSave = true;
            }
            catch (Exception ex)
            {
                SafeSave = false;
                System.Diagnostics.Trace.WriteLine(string.Format("AuctionGas ApiWebServices Auditoria: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name));

                throw new Exception((string.Format("AuctionGas ApiWebServices Auditoria: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name)));
            }
            return(SafeSave);
        }
예제 #29
0
 internal void RefreshReleaseFare(TradeInfo trade)
 {
     checkRefresh(trade);
     Purchaser.RefreshReleaseFare(trade);
     if (Provider != null)
     {
         Provider.RefreshReleaseFare(trade);
     }
     if (Supplier != null)
     {
         Supplier.RefreshReleaseFare(trade);
     }
     if (_royalties != null)
     {
         foreach (var royalty in _royalties)
         {
             royalty.RefreshReleaseFare(trade);
         }
     }
     if (Platform != null && Platform.Deduction != null)
     {
         Platform.Deduction.RefreshReleaseFare(trade);
     }
     _tradement = null;
 }
예제 #30
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #31
0
	public void Show(string packageName, string buy_id, string USD, int cash, Purchaser p) {
		this.packageID = packageName;
		this.buyId = buy_id;
		this.USD = USD;
		this.Cash = cash;

		// cash 이벤트 등록

		if (this.USD == null || this.USD == this.usd_suffix) {
			this.btn_usd.gameObject.SetActive (false);	
		} else {
			this.btn_usd.gameObject.SetActive (true);

			this.buyPackageMoney.buyId = this.buyId;

			EventDelegate e;

			// 유료 결제 이벤트 등록
//			#if UNITY_ANDROID
//			e = new EventDelegate(GoogleIABManager.Instance, "Buy");
//
//			#elif UNITY_IOS 
//			e = new EventDelegate(IOSManager.Instance, "BuyItem");
//
//			#endif

//			e = new EventDelegate(p, "BuyNonConsumable");

//			e.parameters [0].value = this.buyId;
//			this.btn_usd.onClick.Add (e);

			this.btn_usd.onClick.Add (new EventDelegate (p, "BuyNonConsumable"));
		}

		if (this.cash < 0) {
			this.btn_cash.gameObject.SetActive (false);
		} else {
			this.btn_cash.gameObject.SetActive(true);

			this.buyPackage.packageId = this.packageID;
			this.buyPackage.cash = this.cash;
		}

		this.window.Show (ZinWindow.OpendWindow);
	}