Esempio n. 1
0
 public ActionResult Added(MultiModelDto multi)
 {
     _ıdentityService.Add(multi.Identity);
     _adaptationService.Add(multi.Adaptation);
     _awardService.Add(multi.Award);
     return(View());
 }
Esempio n. 2
0
 public IActionResult OdulEkle(YazilimciViewModels yazilimciViewModels)
 {
     int developerId = Convert.ToInt32(HttpContext.Session.GetString("SessionDeveloperId"));
     if (yazilimciViewModels.FormAward.Title.Length > 1 && yazilimciViewModels.FormAward.Description.Length > 5)
     {
         yazilimciViewModels.FormAward.DeveloperId = developerId;
         _awardService.Add(yazilimciViewModels.FormAward);
     }
     TempData["AddSuccessMessage"] = "Ödül Ekleme Başarıyla Gerçekleştirildi.";
     return RedirectToAction("YazilimciProfil", "Uye");
 }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (!this.isEdit)
            {
                this.isEdit = true;
                this.tbAwardList.IsEnabled = true;
                this.btnSave.Content       = "保存";
                this.tbTip.Text            = "";
                return;
            }

            List <Award> awards = new List <Award>();
            var          text   = this.tbAwardList.Text;

            try
            {
                var awardTxts = this.tbAwardList.Text.Split(new String[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < awardTxts.Length; i++)
                {
                    var awardTxt   = awardTxts[i];
                    var fieldTexts = awardTxt.Split(' ');
                    var mark       = fieldTexts[0];
                    var name       = fieldTexts[1];
                    var number     = Convert.ToInt32(fieldTexts[2]);
                    awards.Add(new Award(0, name, number, mark, 0));
                }
            }
            catch (Exception ex)
            {
                this.tbTip.Text = "输入有误:" + ex.Message;
                return;
            }

            new Thread(() => {
                this.Dispatcher.Invoke(() => {
                    this.tbTip.Text        = "正在保存...";
                    this.btnSave.IsEnabled = false;
                });

                service.Clear();
                service.Add(awards);

                this.Dispatcher.Invoke(() => {
                    this.tbTip.Text        = "保存完成";
                    this.btnSave.IsEnabled = true;
                });
            }).Start();

            this.isEdit = false;
            this.tbAwardList.IsEnabled = false;
            this.btnSave.Content       = "修改";
        }
Esempio n. 4
0
        public ActionResult Add(Award award)
        {
            if (ModelState.IsValid)
            {
                var errors = _awardService.ValidateAward(award);
                if (!errors.Any())
                {
                    _awardService.Add(award);

                    return(RedirectToAction("Manage"));
                }
                ModelState.Merge(errors);
            }

            ViewBag.Games = _gameService.GetAll();
            return(View(award));
        }
 public AwardViewModel CreateAward(AwardViewModel awardViewModel)
 {
     return(Mapper.Map <AwardViewModel>(_awardService.Add(awardViewModel.Success, awardViewModel.Fail, awardViewModel.Quit, awardViewModel.Level)));
 }
        public ActionResult AwardAdd(Award award)

        {
            _awardService.Add(award);
            return(RedirectToAction(""));
        }