public void FillInfo() { Customer customer = new Customer(); cDal = new CallerIDDAL(); try { customer = cDal.selectCustomer(info.phoneNumber); } catch (Exception e) { MessageBox.Show(e.ToString()); } if (info != null) { txtPhoneLine1.Text = info.phoneNumber; if (customer != null) { txtNameLine1.Text = customer.Name; txtLastNameLine1.Text = customer.LastName; addressLine1.Text = customer.Address; if (!string.IsNullOrEmpty(customer.Region)) txtRegionLine1.Text = customer.Region; if (string.IsNullOrEmpty(customer.CustomerNote)) txtNoteLine1.Text = customer.CustomerNote; } } }
public void insertCustomer() { cDal = new CallerIDDAL(); Customer customer = new Customer(); bool inserted = false; customer.Name = txtNameLine1.Text; customer.LastName = txtLastNameLine1.Text; customer.Address = addressLine1.Text; customer.Phone = txtPhoneLine1.Text; customer.Region = txtRegionLine1.Text; customer.CustomerNote = txtNoteLine1.Text; if (customer != null) { inserted = cDal.insertNewCustomer(customer); } if (!inserted) MessageBox.Show("Müşteri ad, soyad ve adres bilgilerini lütfen eksiksiz bir şekilde doldurunuz."); }