public IHttpActionResult PutUpisuje(int id, Upisuje upisuje)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != upisuje.UpisujeId)
            {
                return(BadRequest());
            }

            db.Entry(upisuje).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UpisujeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public UpisujeIndexForm()
        {
            InitializeComponent();
            upisiGridView.BorderStyle = BorderStyle.None;

            upisiGridView.EnableHeadersVisualStyles = false;
            upisiGridView.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            upisiGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(74, 76, 78);
            upisiGridView.ColumnHeadersDefaultCellStyle.ForeColor = Color.FromArgb(255, 255, 255);

            upisiGridView.RowsDefaultCellStyle.BackColor            = Color.FromArgb(30, 32, 31);
            upisiGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(30, 32, 31);
            upisiGridView.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            upisiGridView.DefaultCellStyle.SelectionBackColor = Color.FromArgb(52, 56, 55);
            upisiGridView.DefaultCellStyle.SelectionForeColor = Color.FromArgb(255, 255, 255);
            upisiGridView.BackgroundColor     = Color.FromArgb(30, 32, 31);
            upisiGridView.AutoGenerateColumns = false;
            KandidatId        = 0;
            this.AutoValidate = AutoValidate.Disable;
            u = new Upisuje();
            bindInstruktori();
            bindKandidati();
            bindUplata();

            //bindGrid();
        }
        public IHttpActionResult PostUpisuje(Upisuje upisuje)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Upisuje.Add(upisuje);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = upisuje.UpisujeId }, upisuje));
        }
        public IHttpActionResult DeleteUpisuje(int id)
        {
            Upisuje upisuje = db.Upisuje.Find(id);

            if (upisuje == null)
            {
                return(NotFound());
            }

            db.Upisuje.Remove(upisuje);
            db.SaveChanges();

            return(Ok(upisuje));
        }