protected void btnNewOfferSubmit_Click(object sender, EventArgs e) { if (validateOffer()) { Database db = new Database(); Album album = db.getAlbumByNameAndYear(ddAlbumName.SelectedItem.Text.Trim(), Int32.Parse(ddAlbumYear.SelectedItem.Text.Trim())); string offerDesc = txbNewOfferDescription.Text.Trim(); int price = -1; Int32.TryParse(txbNewOfferPrice.Text.Trim(), out price); string name = ddAlbumName.SelectedItem.Text; int albumid = album.ID; int brslika = Int32.Parse(ddPictureNumber.SelectedItem.Text.Trim()); int exchange = chkNewOfferExchange.Checked ? 1 : 0; String username = Session["UserName"].ToString(); DateTime datum = DateTime.Now; int quantity = 1; bool executeQuery = db.addOffer(offerDesc, price, name, albumid, brslika, exchange, username, datum, quantity); System.Diagnostics.Debug.WriteLine("executeQuery" + executeQuery.ToString()); if (executeQuery) { lblErrorInput.Text = "Успешно додадена нова понуда."; lblErrorInput.ForeColor = Color.Green; pnlErrorInput.Update(); clearNewOffer(); // TODO: Review this new feature... refreshPage(); } else { lblErrorInput.Text = "Понудата не е додадена успешно."; } } else { System.Diagnostics.Debug.WriteLine("Paga na validacija..."); lblErrorInput.Text = "Грешка во валидација"; } }
protected void btnNewOfferSubmit_Click(object sender, EventArgs e) { if (validateOffer()) { Database db = new Database(); Album album = db.getAlbumByNameAndYear(ddAlbumName.SelectedItem.Text.Trim(), Int32.Parse(ddAlbumYear.SelectedItem.Text.Trim())); string offerDesc = txbNewOfferDescription.Text.Trim(); int price = -1; Int32.TryParse(txbNewOfferPrice.Text.Trim(), out price); string name = ddAlbumName.SelectedItem.Text; int albumid = album.ID; int brslika = Int32.Parse(ddPictureNumber.SelectedItem.Text.Trim()); int exchange = chkNewOfferExchange.Checked ? 1 : 0; String username = Session["UserName"].ToString(); DateTime datum = DateTime.Now; int quantity = 1; bool executeQuery = db.addOffer(offerDesc, price, name, albumid, brslika, exchange, username, datum, quantity); System.Diagnostics.Debug.WriteLine("executeQuery" + executeQuery.ToString()); if (executeQuery) { lblErrorInput.Text = "Успешно додадена нова понуда."; lblErrorInput.ForeColor = Color.Green; pnlErrorInput.Update(); clearNewOffer(); // TODO: Review this new feature... refreshPage(); } else { lblErrorInput.Text = "Понудата не е додадена успешно."; } } else { System.Diagnostics.Debug.WriteLine("Paga na validacija..."); lblErrorInput.Text = "Грешка во валидација"; } }