protected void btn_update_Click( object sender, EventArgs e )
        {
            string pid = this.txtbox_pid.Text.Trim().ToString().ToUpper();
            string did = this.txtbox_did.Text.Trim().ToString().ToUpper();
            string cid = this.txtbox_cid.Text.Trim().ToString().ToUpper();
            BusinessTier.Admin admin = new BusinessTier.Admin();

            if ( pid.Length > 0 && did.Length > 0 && cid.Length > 0 )
            {
                if ( admin.CheckPatientBeforeAssign(pid) == true )
                {
                    if ( admin.isMember(did) == true && admin.isMember(cid) == true )
                    {
                        admin.updateAssignment(pid, did, cid);
                    }
                    else
                    {
                        this.lbl_didwarning.Text = "Check if this ID is exsited";
                        this.lbl_cidwarning.Text = "Check if this ID is exsited";
                    }
                }
                else
                {
                    this.lbl_pidwarning.Text = "No such patient ID";
                }
            }
        }
        protected void btn_add_Click( object sender, EventArgs e )
        {
            string pid = this.txtbox_pid.Text.Trim().ToString().ToUpper();
            string did = this.txtbox_did.Text.Trim().ToString().ToUpper();
            string cid = this.txtbox_cid.Text.Trim().ToString().ToUpper();
            bool hasThePatient;
            bool hasTheDoctor;
            bool hasTheCare;

            if ( pid.Length > 0 && did.Length > 0 && cid.Length > 0 )
            {
                BusinessTier.Admin admin = new BusinessTier.Admin();
                hasThePatient = admin.CheckPatientBeforeAssign(pid);
                hasTheDoctor = admin.isMember(did);
                hasTheCare = admin.isMember(cid);

                if ( hasThePatient == true )
                {
                    this.lbl_pidwarning.Text = "Duplicate patient ID";
                }
                if ( hasThePatient == false )
                {
                    if ( hasTheCare == true && hasTheDoctor == true )
                    {
                        admin.AddAssignment(pid, did, cid);
                        this.gv_assignments.DataSource = admin.SelectAllAssignments();
                        this.gv_assignments.DataBind();
                    }
                    else
                    {
                        this.lbl_didwarning.Text="Check this ID before assgin";
                        this.lbl_cidwarning.Text="Check this ID before assign";
                    }
                }
            }
        }