public int Customer_Insert(Customer entity) { using (SqlConnection connection = new SqlConnection(AppConfiguration.ConnectionString)) { try { SqlCommand command = new SqlCommand("Customer_Insert", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@Customer_FulName", SqlDbType.NVarChar); command.Parameters["@Customer_FulName"].Value = entity.Customer_FulName; command.Parameters.Add("@Customer_Address", SqlDbType.NVarChar); command.Parameters["@Customer_Address"].Value = entity.Customer_Address; command.Parameters.Add("@Customer_Phone", SqlDbType.NVarChar); command.Parameters["@Customer_Phone"].Value = entity.Customer_Phone; connection.Open(); return command.ExecuteNonQuery(); } catch (Exception) { throw; } finally { connection.Dispose(); } } }
public int Customer_Update(Customer entity) { return customer.Customer_Update(entity); }
public int Customer_Insert(Customer entity) { return customer.Customer_Insert(entity); }