コード例 #1
0
        protected void cuvSkillSets_ServerValidate(object source, ServerValidateEventArgs args)
        {
            if (Page.IsValid)
            {
                Skillset objSkillset = new Skillset();

                if (objSkillset.isSkillSetExist(txtSkillSetsCreated.Text) == true)
                {
                    args.IsValid = false;
                }
                else
                {
                    args.IsValid = true;
                }
            }
        }
コード例 #2
0
        protected void btnSkillSetConfirm_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Skillset objSkillset = new Skillset();

                objSkillset.skillSetName = txtSkillSetsCreated.Text;

                int id = objSkillset.add();

                txtSkillSetsCreated.Text = "";

                if (id == 5) //To make sure it is inserted
                {
                    lblSkillSetStatus.Text = "Skillset successfully inserted";
                }
            }
        }