コード例 #1
0
        protected void btn_update_Click( object sender, EventArgs e )
        {
            //defaultStatus();
            string cid = this.txtbox_careID.Text;
            string name = txtbox_name.Text;
            string gender = txtbox_gender.Text;
            string contactno = txtbox_contactno.Text;
            int age = int.Parse(this.txtbox_age.Text);

            if ( cid.Length > 0 && name.Length > 0 && gender.Length > 0 && contactno.Length > 0 && age.ToString().Length > 0 )
            {
                BusinessTier.Admin admin = new BusinessTier.Admin();
                Data.DataBase.caretakersDataTable table = new Data.DataBase.caretakersDataTable();
                table = admin.SearchCareTakerByID(cid);
                if ( table.Rows.Count > 0 )
                {
                    admin.UpdateCareTaker(name, gender, contactno, age, cid);
                }
                else
                {
                    this.lbl_idwarning.Text = "This ID is not exsit";
                    this.lbl_idwarning.BackColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                errorWarning();
            }
        }