示例#1
0
        private void btn_AddAward_Click(object sender, EventArgs e)
        {
            var form = new AwardForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                awardBL.Add(new Award(form.Title, form.Description));
                DisplayAwards();
            }
        }
示例#2
0
        private void AddAward()
        {
            var form = new AwardForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                listOfAwards.Add(new Award(_awardId, form.AwardName, form.AwardDesc));
                DisplayAwards();
            }
        }
示例#3
0
        private void AddAward()
        {
            var form = new AwardForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                listOfAwards.Add(new Award(_awardId++, form.AwardName, form.AwardDesc));
                ctrGridAward.DataSource = null;
                ctrGridAward.DataSource = listOfAwards;
            }
        }
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         listOfAwards.Add(collection["AwardName"], collection["AwardDescription"]);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(Award award)
 {
     try
     {
         awards.Add(award);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }