private Email ReceiveHtml() { Email email = new Email(); email.EmailID = (hddEmailID.Value != "") ? Convert.ToInt32(hddEmailID.Value) : 0; email.Name = txtName.Text; email.EmailAddress = txtEmailAddress.Text; return email; }
public void CreateEmail(Email email) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_EmailUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@EmailID", 0); command.Parameters.AddWithValue("@EmailAddress", email.EmailAddress); command.Parameters.AddWithValue("@Name", email.Name); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("khong them moi duoc email"); } command.Dispose(); } }
public void UpdateEmail(Email email) { new EmailDAO().UpdateEmail(email); }
public void CreateEmail(Email email) { new EmailDAO().CreateEmail(email); }