Beispiel #1
0
 protected void btnFindId_Click(object sender, EventArgs e)
 {
     try
     {
         People people = new People();
         people.find("[people_id] = '" + this.tbID.Text + "'");
         this.Image1.ImageUrl = this.pictureLocation + this.pictureDefault;
         if (people.PeopleId != null)
         {
             string path = this.pictureLocation + this.tbID.Text + this.pictureFormat;
             if (MyFile.Exists(path))
             {
                 this.Image1.ImageUrl = path;
             }
             this.lblFirstName.Text = people.FirstName;
             this.lblLastName.Text = people.LastName;
         }
         else
         {
             this.lblFirstName.Text = "";
             this.lblLastName.Text = "";
             throw new Exception("Invalid ID");
         }
         Customer customer = new Customer();
         customer.find("(c.[PeopleID]='" + this.tbID.Text + "')");
         if (customer.PeopleID != null)
         {
             throw new Exception("Already Exists");
         }
         this.prepareError(null);
     }
     catch (Exception exception)
     {
         this.prepareError(exception.Message);
     }
     this.tbID.Focus();
 }