Beispiel #1
0
 public void Save()
 {
     if (Validate_txt_firstname() && Validate_txt_LastName() && ValidatephoneNo())
     {
         ContactsBAL contact = new ContactsBAL();
         contact.cnt_id        = id;
         contact.cnt_FirstName = txt_firstname.Text;
         contact.cnt_LastName  = txt_LastName.Text;
         contact.cnt_Number    = txt_Number.Text;
         contact.status        = true;
         if (contact.cnt_id == 0)
         {
             db.Add(contact);
         }
         else
         {
             db.Update(contact);
         }
         LoadPhonebook();
         Clear();
     }
 }
 public bool Add(Contacts Model)
 {
     return(CDAL.Add(Model));
 }