示例#1
0
        protected void OnInsert(object sender, EventArgs e)
        {
            try
            {
                if (IsValid)
                {
                    CardAttributeType attributeCard = new CardAttributeType(int.Parse(cardDropDownList.SelectedValue), int.Parse(powerTextBox.Text), int.Parse(toughnessTextBox.Text));
                    cardAttService = new CardsAttributesService(attributeCard);
                    if (cardAttService.InsertAttributeCard() > 0)
                    {
                        Response.Write("<script>alert('Successfully inserted');</script>");
                    }
                    else
                    {
                        Response.Write("<script>alert('Insertion failed');</script>");
                    }
                }
            }


            catch (Exception ex)
            {
                Debug.WriteLine(ex.StackTrace);
            }
        }
 public CardsAttributesService(CardAttributeType cardAttribute)
 {
     this.cardAttribute = cardAttribute;
 }