예제 #1
0
        public Borba Insert(InsertBorbaRequestModel Model)
        {
            if (Model == null)
            {
                throw new Exception("Model je prazan!");
            }
            if (Model.Suparnik == null)
            {
                throw new Exception("Morate unijeti suparnika na takmičenju!");
            }
            var novaBorba = Mapper.Map <Borba>(Model);

            Context.Borbe.Add(novaBorba);
            Context.SaveChanges();
            return(novaBorba);
        }
예제 #2
0
        private async void Btn_Snimi_Click(object sender, EventArgs e)
        {
            InsertBorbaRequestModel Model = new InsertBorbaRequestModel
            {
                TakmicarId           = TakmicarId,
                TakmicenjeId         = TakmicenjeId,
                CrveneRukaviceBodovi = int.Parse(Txt_CrveniBodovi.Text),
                PlaveRukaviceBodovi  = int.Parse(Txt_PlaviBodovi.Text),
                Suparnik             = Txt_Suparnik.Text
            };
            await _ClanService.Insert <Borba>(Model, "Borbe");

            Hide();
            FrmClanTakmicenjeBorbe frm = new FrmClanTakmicenjeBorbe(TakmicarId, TakmicenjeId);

            frm.ShowDialog();
        }
예제 #3
0
 public Borba DodajBorbu(InsertBorbaRequestModel Model)
 {
     return(_ClanService.Insert(Model));
 }