Ejemplo n.º 1
0
        private void bindAukcije()
        {
            int id = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);

            aukcije.DataSource = DBAukcija.AukcijeByKorisnik(id);
            aukcije.DataBind();
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int ID = Convert.ToInt32(Request.QueryString["id"]);

            Services.Data.Aukcije aukc = DBAukcija.SelectByID(ID);

            LabelNaslov.Text = aukc.Igre.Naziv;

            LabelPočetak.Text = aukc.DatumOD.ToShortDateString();
            LabelKraj.Text    = aukc.DatumDO.ToShortDateString();

            int id = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);

            List <Services.Data.AukcijeBYKupac_Result1> ponude = DBAukcija.AukcijeByKorisnik(id);

            decimal po = 0;

            foreach (AukcijeBYKupac_Result1 auk in ponude)
            {
                if (auk.AukcijeID == ID)
                {
                    if (auk.Ponuda > po)
                    {
                        po = auk.Ponuda;
                    }
                }
            }

            LabelTrenutna.Text = po.ToString();



            Image1.ImageUrl = "imageHandler.ashx?id=" + ID;
        }
Ejemplo n.º 3
0
        protected void dodajOcjenu_Click(object sender, EventArgs e)
        {
            if (User.Identity.Name != "")
            {
                int KupacID = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);
                int ocjena  = Convert.ToInt32(Ocjena.SelectedValue);

                int ID = Convert.ToInt32(Request.QueryString["id"]);


                Ocjene oc = new Ocjene();

                oc.Ocjena     = ocjena;
                oc.KupacID    = KupacID;
                oc.ProizvodID = ID;
                oc.Datum      = DateTime.UtcNow;

                DBOcjene.InsertOcjene(oc);

                Labelerror.Text = "Uspješno ste ocjenili proizvod!";
            }
            else
            {
                Labelerror.Text = "Da bi ste ocjenili proizvod morate biti logirani!";
            }
        }
Ejemplo n.º 4
0
        protected void glasaj_Click(object sender, EventArgs e)
        {
            int KupacID   = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);
            int ZahtjevID = Convert.ToInt32(Request.QueryString["id"]);

            if (DBZahtjevi.ZahtjeviKupciProvjera(ZahtjevID, KupacID) >= 1)
            {
                LabelError.Text = "Već ste glasali za ovaj zahtjev!";
            }
            else
            {
                DBZahtjevi.ZahtjeviKupciInsert(ZahtjevID, KupacID);
                LabelError.Text = "Uspješno ste glasali";
                glasovi.Text    = DBZahtjevi.SelectZahtjevi(ZahtjevID).ToString();
                pglasova.Text   = (20 - DBZahtjevi.SelectZahtjevi(ZahtjevID)).ToString();
            }
        }
Ejemplo n.º 5
0
 protected void ButtonDodaj_Click(object sender, EventArgs e)
 {
     if (TextBoxZahtjev.Text == "")
     {
         zahtjevError.Text = "Unesite vaš zahtjev";
     }
     else
     {
         Services.Data.Zahtjevi zahtjev = new Services.Data.Zahtjevi();
         zahtjev.Naslov = TextBoxZahtjev.Text;
         zahtjev.Datum  = DateTime.Now;
         int KupacID = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);
         zahtjev.KupacID = KupacID;
         DBZahtjevi.InsertZahtjev(zahtjev);
         BindZahtjevi();
         zahtjevError.Text = "";
     }
 }
Ejemplo n.º 6
0
        protected void ButtonDodaj_Click(object sender, EventArgs e)
        {
            int ID = Convert.ToInt32(Request.QueryString["id"]);

            int KupacID = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);

            if ((TextBoxDodaj.Text == "") || (Convert.ToDecimal(TextBoxDodaj.Text) < Convert.ToDecimal(LabelTrenutna.Text)))
            {
                error.Visible = true;
            }
            else
            {
                error.Visible = false;
                DBAukcija.UpdateAukcija(KupacID, Convert.ToDecimal(TextBoxDodaj.Text), ID);
                LabelTrenutna.Text = TextBoxDodaj.Text;
                TextBoxDodaj.Text  = "";
            }
        }
Ejemplo n.º 7
0
        private void bindgrid()
        {
            int id = DBKupci.SelectIDByKorisnickoIme(User.Identity.Name);

            List <SELECTNARUDZBABYKUPAC_Result> Sve = DBNarudzbe.SelectAllNarudzbe(id);

            Sve = Sve.GroupBy(x => x.NarudzbaID).Select(x => x.First()).ToList();


            DropDownListHistory.DataSource = Sve;


            DropDownListHistory.DataValueField = "NarudzbaID";
            DropDownListHistory.DataTextField  = "Datum";



            DropDownListHistory.DataBind();
        }