示例#1
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Checker())
     {
         if (txtClientID.Text != "")
         {
             ClientsModel client = new ClientsModel(
                 Convert.ToInt32(txtClientID.Text),
                 txtFirstName.Text,
                 txtLastName.Text,
                 txtBarcode.Text,
                 txtPhoneNumber.Text,
                 Convert.ToDecimal(txtDiscount.Text)
                 );
             SqliteDataAccess.EditClient(client);
         }
         else
         {
             ClientsModel client = new ClientsModel(
                 txtFirstName.Text,
                 txtLastName.Text,
                 txtBarcode.Text,
                 txtPhoneNumber.Text,
                 Convert.ToDecimal(txtDiscount.Text),
                 0
                 );
             SqliteDataAccess.CreateClient(client);
         }
         form.Refresh();
         this.Close();
     }
 }